PatternCron

Every weekday at 9:00

The classic working-hours schedule: 09:00 Monday to Friday, weekends silent — and how the five cron fields produce it.

Last updated

Pattern
0 9 * * 1-5
Open in Crontab Schedule Creator

In plain English

  • Fires Monday–Friday at 09:00
  • Silent on Saturday and Sunday

Why it’s written this way

Reading the five fields left to right: minute 0, hour 9, any day of the month, any month, days-of-week 1 through 5. Cron numbers weekdays with Monday as 1 through Saturday as 6 — and both 0 and 7 mean Sunday.

Restricting the day-of-week field while leaving day-of-month as * is the standard way to schedule by weekday; the * fields simply impose no constraint.

Edge cases to know

  • →Cron runs in the server's timezone. A 9:00 job on a UTC server fires at 14:30 in Mumbai — decide which clock you mean before shipping it.
  • →If BOTH day-of-month and day-of-week are restricted, classic cron fires when EITHER matches (OR, not AND) — the most surprising rule in cron.
  • →No catch-up: if the machine is off at 9:00, that run is skipped, not queued.

Part by part

0 9
Minute 0 of hour 9 — nine o'clock exactly. Reading a cron line left to right as minute-then-hour is the habit that prevents most misreadings.
* *
Day-of-month and month, both unrestricted. Leaving these as wildcards is what keeps the schedule weekly rather than tied to a date.
1-5
Day-of-week as a range: Monday through Friday. Sunday is 0, so 1-5 lands on the working week without needing to know where the week starts.

Common mistakes

  • 0 9 * * 1,5

    A comma is a list, not a range, so this runs on Monday and Friday only — two days instead of five. The typo survives review easily because both forms look deliberate.

    0 9 * * 1-5
  • 9 * * * 1-5

    Swapping the first two fields gives minute 9 of every hour, so instead of one daily run you get twenty-four, every weekday. Reading the fields in order is the only defence.

  • 0 9 * * 0-4

    Off by one at the start of the week. Because Sunday is 0 rather than Monday, this schedules Sunday to Thursday — it looks like five weekdays and quietly includes the weekend.

Questions

Does this account for public holidays?

No. Cron has no concept of a holiday calendar, so a weekday schedule fires on Christmas Day like any other Thursday. If that matters, the check belongs in the script rather than in the schedule.

What happens when the clocks change?

For a nine o'clock job, nothing dramatic — it runs at nine local time either way. Jobs scheduled between roughly one and three in the morning are the risky ones, where an hour can be skipped or repeated depending on the implementation.

Can I write MON-FRI instead of 1-5?

In Vixie cron and most Linux distributions, yes. It is more readable, but day names are not universally supported by schedulers that merely accept cron syntax, so the numeric range is the portable choice.

Why is Sunday 0 rather than 1?

It follows the C library's tm_wday convention, where the week starts on Sunday, and cron inherited it. Many implementations also accept 7 for Sunday as a concession to everyone who expects the week to end there.

Related in Patterns