Cron job

Status
Not open for further replies.

rickje

New Member
Messages
4
Reaction score
0
Points
0
Hi,

I am currently programming my homepage, but I currently having a cron job (script.sh) running and used Crontab in Cpanel to add the follow jobs:

*/7 - 6AM - * * * /home/rick/scripts/script.sh
*/7 - 7AM - * * * /home/rick/scripts/script.sh
*/7 - 8AM - * * * /home/rick/scripts/script.sh
*/7 - 9AM - * * * /home/rick/scripts/script.sh
*/7 - 10AM - * * * /home/rick/scripts/script.sh
*/7 - 11AM - * * * /home/rick/scripts/script.sh

Yesterday it worked to set for just one time at 11:23 but now it does not work. Is it a problem or did I something wrong.


Regards,
 
Last edited:

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
The format for the date and time fields is incorrect. Properly, a hyphen is used for ranges, the hour field should is based on a 24 hour clock and there should only be five fields; you have seven. Remove the hyphens and the AM/PM designators. Rather than having six separate entries, have a single entry with a range for the hour field.

Code:
*/7	6-11	*	*	*	/home/rick/scripts/script.sh

If you use the simple cron editor, it will check all this for you.
 
Last edited:

rickje

New Member
Messages
4
Reaction score
0
Points
0
I feel like a jackass. Thank you for refreshing my memory.
 
Status
Not open for further replies.
Top