From browsing the web I’ve noticed two variations for the command to initiate the WordPress cron jobs from cPanel.
Please could someone explain the difference and which is the correct/best option to use?
-
wget -qO- https://www.mydomain.co.uk/wp-cron.php &> /dev/null
-
wget -q -O - https://www.mydomain.co.uk/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Thanks
2
Answers
you are using cron from WordPress but some plugins disable or prevent CRON from working. My recommendation in this case is either you create this schedule through the Server Cron or you install a plugin to reaffirm your schedule.
I had the same problem it was even a little difficult to find … And as you will see it doesn’t have a current update, but for me it works. https://wordpress.org/plugins/wp-crontrol & https://br.wordpress.org/plugins/advanced-cron-manager/
Send news
Sure, I would love to explain the concept:
>
is for redirect/dev/null
is a black hole where any data sent, will be discarded2
is the file descriptor for Standard Error>
is for redirect&
is the symbol for file descriptor (without it, the following 1 would be considered a filename)1
is the file descriptor for Standard OutTherefore
>/dev/null 2>&1
is redirect the output of your program to/dev/null
. Include both the Standard Error and Standard Out.cron
will only email you if there is some output from you job. With everything redirected tonull
, there is no output and hencecron
will not email you.Hope I explained it more clearly.