Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 6 down vote accepted

Yes it is.

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

share|improve this answer
Might want 0,4-23 there depending on whether you want it to not happen until the end of 4 or at the beginning. – Ignacio Vazquez-Abrams Apr 9 '10 at 21:05
Might want to add 'refer to the man page`: – DaveParillo Apr 9 '10 at 21:53

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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