Different schedule for Weekdays and weekends

1.2k Views Asked by At

In Quartz or Cron is there a way to write a single expression to have different schedules for weekdays and weekends ?

So say 12 noon during weekdays and 8 AM during weekends.

1

There are 1 best solutions below

0
On BEST ANSWER

I don't know of a way to to this in cron with a single expression. You can do it with 2 lines, though.

0 12 * * 1-5 [your script call]
0 8 * * 6,7 [your script call]

The last column (day of week) can have a range, or a list. Day of week is 1-7 (Mon - Sun), either 0 or 7 can represent Sunday. HTH