Why doesn't this Cronjob instruction run?
I have a long standing cronjob running on a cPanel account. Recently I have added a second cronjob instruction to make two in total.
They are here:
ONE:
TWO:
The first, has been long standing and I believe this to be working correctly.
The second, is new and the instruction "/usr ....error_cleaner.php .... 2>&1" works perfectly when run from the Terminal command line.
The Cron timings ate also correct as per cron-tab guru, to run on the 0,8,16th hour each day. However, I am not seeing any indictication on the system that this crontab ever actually runs (no purposeful error reports that the script ran).
How can I diagnose this ?
| */5 | 22-23,0-1 | * | * | * | /usr/local/bin/php /home/account/crons/cron_mailer.php >/dev/null 2>&1 |
| 15 | 0,8,16 | * | * | * | /usr/local/bin/php /home/account/crons/error_cleaner.php >/dev/null 2>&1 |
-
Hey there! Inside /var/log/cron, you should see entries similar to the following when you edit the user's cron jobs: Jan 16 07:36:08 host crontab[196369]: (hattmonk) LIST (username) Jan 16 07:36:10 host crontab[196375]: (hattmonk) LIST (username) Jan 16 07:36:30 host crontab[196388]: (hattmonk) LIST (username) Jan 16 07:36:30 host crontab[196389]: (hattmonk) REPLACE (username) Jan 16 07:36:30 host crontab[196391]: (hattmonk) LIST (username)
If you see those, that at least tells you the cron job is saving properly from the cPanel interface. When the job is executed, you'll see the following entry:Jan 16 07:37:01 host CROND[196416]: (hattmonk) CMD (your-cron-command-here)
Do you see that show up in the log file?0 -
Hi @cPRex thanks for the help there. My cron's log last entry for this is: Jan 16 00:15:01 basic CROND[4487]: (account) CMD (/usr/local/bin/php /home/account/crons/error_cleaner.php >/dev/null 2>&1)
And nothing since then. Expecting 0815 and 1215 (time here now is 1403) The most recent records in this file are:Jan 16 12:15:02 basic crontab[14752]: (account) LIST (account) Jan 16 12:15:04 basic crontab[14872]: (account) LIST (account)
Which is the correct sort of time (hh:15) but may possibly be co-incidence of when I was exploring the issue.0 -
Also of interest is I'm seemingly unable to post messages on this forum containing / var / log / cron string (without spaces); with a popup saying forum has run into a problem 0 -
Yeah, that's the Cloudflare forum protection. It seems to be overly aggressive lately with file paths. Just to confirm, you added the cron through the cPanel interface, correct? 0 -
Just to confirm, you added the cron through the cPanel interface, correct?
Yes, entirely through the CPanel account interface. Thanks.0 -
You mentioned it works when run from the command line - are you logged into SSH as the cPanel user when trying this? If so, I don't have any other ideas on why that isn't working, so it's likely time to make a ticket. 0 -
You mentioned it works when run from the command line - are you logged into SSH as the cPanel user when trying this?
I am using the WHM terminal (as root). I will raise a ticket and feedback the conclusion. Thanks. :)0
Please sign in to leave a comment.
Comments
7 comments