PatternCron
Every 2 hours on workdays
Business-hours monitoring without the noise of an hourly job: fires every 2 hours, but only Monday through Friday.
Last updated
In plain English
- Fires every even hour, Monday through Friday
- 60 runs per week
Why it’s written this way
*/2 in the hour field yields 0, 2, 4 … 22 — every even hour — while day-of-week 1-5 restricts those runs to Monday through Friday. Day-of-month is untouched, so only the weekday field is doing any filtering.
Because day-of-month stays *, there's no OR-versus-AND ambiguity here: with only ONE of the two day fields restricted, cron behaves like a plain filter — weekends are simply excluded, nothing more surprising than that.
Edge cases to know
- →Even hours means the job never fires at odd hours like 09:00 or 13:00 — if 'business hours' really means 9-to-5, this lands at 10, 12, 14, 16, not on those neat boundaries. Use an explicit hour list if exact times matter.
- →The last weekday run is 22:00 Friday; nothing fires again until 00:00 Monday — a roughly 50-hour gap that can look like an outage on a dashboard expecting continuous data.
- →A public holiday that falls on a weekday still runs the job — day-of-week only knows Monday-through-Friday as calendar positions, not which of them are actually working days.