Schedule a cron job ev X minutes, but exclude it from certain hours in the morning?

7,961

Yes it is.

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

Share:
7,961
sarath
Author by

sarath

Updated on September 17, 2022

Comments

  • sarath
    sarath over 1 year

    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.

  • Ignacio Vazquez-Abrams
    Ignacio Vazquez-Abrams about 14 years
    Might want 0,4-23 there depending on whether you want it to not happen until the end of 4 or at the beginning.
  • DaveParillo
    DaveParillo about 14 years
    Might want to add 'refer to the man page`: ss64.com/bash/crontab.html