Reputation: 11
I want to run a CRON command on certain days of the month at different times.
I have set up the CRON as indicated below:
40 8 5 12 6 php /home/username/public_html/path_to_php_script
This is supposed to run at 8:40am on 5th December I presume but it never does.
I noticed it only works when I use the common settings:
Example: */5 * * * * php /home/username/public_html/path_to_php_script
This is supposed to run every five minutes
I have read a lot of suggestions on StackOverflow and other articles including the official documentation on cPanel.net all to no avail.
Any suggestions?
Thanks in advance.
Upvotes: 0
Views: 872
Reputation: 11
The timezone was the problem in my case. The CRON job actually works fine but the time on the server was 8 hours behind so I had to back date the time.
You could also change the time on the server if you had access to the WHM.
Upvotes: 0
Reputation: 1054
You must not set the weekday. Just any (*) day.
40 8 5 12 * php /home/username/public_html/path_to_php_script
Upvotes: 1