0

Looking for some guidance around setting up a cron job to run every 15 minutes that sets off a script within the WordPress Plugin Amelia. According to their docs, I need to add the following line to the Cron file:

*/15 * * * * https://domain.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/notifications/scheduled/send

Now as I'm using CPanel I set up the cronjob using the gui so it looks something like this. Swapping https://domain.com for the actual domain.: enter image description here

I've added quotes to the command as I was getting errors because it was splitting the command when reaching an & but I am still getting an error saying the directory is not found.

Any help would be great. Thank you in advance.

4
  • 4
    An URL is not a command. Did you mean to call curl with this URL? Commented Jun 7, 2020 at 10:34
  • @Kusalananda not 100% sure as I'm trying to follow the documentation set out by the API. They mention no use of Curl. However willing to give it a try. I have tried wget -q -O - https://mydomian.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/notifications/scheduled/send but no luck. Commented Jun 7, 2020 at 11:35
  • 1
    your wget command is without "added quotes to the command as I was getting errors" Commented Jun 7, 2020 at 12:15
  • Explain exactly what you wan the cron job to do. Commented Jun 7, 2020 at 13:49

2 Answers 2

0

Can you try updating the command section to

GET 'https://domain.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/notifications/scheduled/send' > /dev/null

You can try running the same command without > /dev/null , if the shell access is available.

0

The notifications documentation as available in July 2023 doesn't match what you were trying:

Also, you can try this:

*/15 * * * * wget -q -O – "https://www.yourwebsite.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/notifications/scheduled/send"

This:

*/15 * * * * /usr/local/bin/php ~/public_html/wp-cron.php –action='wpamelia_api’ –call=’/notifications/scheduled/send'

Or this:

GET 'https://yourdomain.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/notifications/scheduled/send' > /dev/null

Comparing the first suggestion with your own attempt, you appear to have omitted the command itself and the double quotes from the cron command line, wget -q -O -. (I had to replace the "smart quotes" in the documentation with standard single and double quote marks; perhaps that was your problem.)

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.