-1

I have many crons that run at different intervals. I need to configure them all to not run between two specific time ranges. How can I configure a unix cron to run exclusive of 11:45-13:00 and 14:45-16:00?

If the minutes is not possible, 12:00-13:00 and 15:00 - 16:00 would suffice. Thanks!

0

2 Answers 2

0

For the second part, specifying the valid hours in the second component works nicely:

* 0-11,14,17-23 * * * command

For the first, your best bet is going to be handling it in the logic of the script the command is running itself. If need be, have a bash script that does the time calculation and executes the real command if it's an appropriate time.

0

Configure the ranges you want them to run e.g:

* 0-11,13-14,16-23 * * * exec

Not the answer you're looking for? Browse other questions tagged .