1

Is it possible to make a cron job run say, every 20 minutes, but make it not run for say, 1-4 in the morning.

7

Yes it is.

0,20,40 0,5-23 * * * /job/to/run

0

Don't forget that if you need more specific or complicated rules that can't be covered by the version of cron you're using, you can always write a small shellscript wrapper which will check the date +%H or other relevant statuses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.