Cron Help

jayw1

Verified User
Joined
Nov 20, 2019
Messages
117
Location
USA
Hi. Just want to check, will the following run every 5 minutes or once an hour on the 5th minute?

cron.png

If it's not running every 5 minutes, how can I make it so?
 

jayw1

Verified User
Joined
Nov 20, 2019
Messages
117
Location
USA
I've used that website before but I'm still unsure of how DA handles it. Can you confirm @smtalk?
 

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
670
Location
Murfreesboro

I have encountered situations where I need to run a job every two, three, or four hours. That can be accomplished by dividing the hours by the desired interval, such as */3 for every three hours, or 6-18/3 to run every three hours between 6 a.m. and 6 p.m. Other intervals can be divided similarly; for example, the expression */15 in the minutes position means "run the job every 15 minutes."

*/5 08-18/2 * * * /usr/local/bin/mycronjob.sh
This cron job runs every five minutes during every hour between 8 a.m. and 5:58 p.m.​
 

jayw1

Verified User
Joined
Nov 20, 2019
Messages
117
Location
USA
I know how to do it with a script but I'm curious only about DirectAdmin's approach. I guess the settings in my screenshot are correct for what I'd like to do.
It'd be nice if there was a "Next Run:" feature on the page.
 

jayw1

Verified User
Joined
Nov 20, 2019
Messages
117
Location
USA
Actually, my screenshot is not the correct way to do it. To run a cron every 5 minutes, I'm pretty sure either of the following would work:

Screenshot from 2019-12-09 23-37-11.png

Screenshot from 2019-12-09 23-36-27.png
 
Top