cron

How can I set a range of hours that pass midnight in my crontab?


I want to set crontab schedule in format 0 19-8 * * * I see error that this format is not supported

I want to run every hour 19, 20, 21, 22, 23, 24, 0, 1, ... 8

I know that this format is working 0 19,20,21,22,23,0,1,2,3,4,5,6,7,8 * * * but how can I set range in my case?


Solution

  • It's not that you want it reversed. You want two ranges separated by a comma.

    0 19-23,0-8 * * *