Run a cron job every 5 minutes between two times

croncrontab

Is there a way to specify a job that runs every 5 minutes between some start time and some end time on business days in a crontab?

Update
I think it's relevant that my start and end times are not at round hours. So, specifying 9-5 in the hour column isn't enough. I want 9:30-17:30.

Best Answer

You'll have to do it piecewise:

30-59/5 9 * * * script.sh
*/5 10-16 * * * script.sh
0-30/5 17 * * * script.sh
Related Question