Cron weekdays at midnight

0 0 * * 1-5

0 0 * * 1-5 runs a job at 00:00, Monday through Friday. Minute and hour are 0, and the day-of-week field 1-5 is the range from Monday (1) to Friday (5). 0 0 * * MON-FRI means the same in most crons.

When it fires

Checked at 09:58 UTC on Wednesday, October 14, the next five runs are:

Thu Oct 15  Fri Oct 16  Mon Oct 19  Tue Oct 20  Wed Oct 21    (all at 00:00)

Saturday and Sunday have no runs, so after Friday’s the next one is on Monday.

Midnight starts the day

Each run lands in the first minute of a weekday. Monday’s run comes straight after Sunday, and the night after Friday, which belongs to Saturday, gets none. A nightly job that processes each working day once it has ended wants the midnights after Monday to Friday, and those fall on Tuesday through Saturday:

0 0 * * 2-6      at 00:00 Tuesday to Saturday, after each working day

Checked from the same Wednesday, that runs on October 15, 16 and 17, then on October 20 and 21. Before picking a range, decide whether the job starts a working day or closes one.

Whose midnight?

The server’s, unless you say otherwise. A server on UTC starts Monday’s run on Sunday evening in the Americas. Set CRON_TZ at the top of the crontab (cronie and others support it), or the timezone setting of the scheduler, to pin the run to a local midnight.

The same schedule elsewhere

  • crontab: 0 0 * * 1-5 /usr/local/bin/nightly.sh.
  • GitHub Actions: cron: '0 0 * * 1-5', at midnight UTC.
  • Kubernetes CronJob: schedule: "0 0 * * 1-5", with spec.timeZone for a local midnight.
  • AWS EventBridge: cron(0 0 ? * MON-FRI *). AWS counts Sunday as 1, so the same days in numbers are 2-6.
  • systemd timer: OnCalendar=Mon..Fri 00:00, which systemd-analyze calendar normalizes to Mon..Fri *-*-* 00:00:00.
  • Spring @Scheduled: 0 0 0 * * MON-FRI.

Try it in the Cron Builder

At 00:00, Monday through Friday

Read as a crontab line, where Sunday is 0 or 7.

minutehourday of monthmonthday of week
00**1-5

Next runs

Working out the next runs from your clock…

Runs in your browser. Nothing you enter is sent anywhere.