cronscheduled-tasks

How to write a cron expression spanning multiple hours with an arbitrary start minute


I want to write a cron expression for every minute from 10:45 am to 11:30 am. Is there a way to write such an expression. I understand that if I set starting minute as 45, it doesn't schedule anything for 11-11:30


Solution

  • No. You'll need to break it up into two cron jobs. 45-59 10 * * * and 0-30 11 * * *.