Cron expression for every Monday

0 9 * * 1

The job runs once a week, on Monday at 09:00.

Runs when: minute 0; hour 9; every day of month; every month; on Mon.

Change it in the cron expression generator

How the five fields read

FieldValueReads as
Minute0at 0
Hour9at 9
Day of month*every value
Month*every value
Day of week1at Monday

The next five runs

What people use it for

Monday is not always day 1

In standard cron Sunday is 0 and Monday is 1. In AWS EventBridge and Quartz the days are numbered from Sunday = 1, so Monday is 2. A job copied between systems on the number alone fires a day late. Write the day as MON in EventBridge and Quartz, which cannot be misread.

Variations of every Monday

ExpressionWhat it does
0 0 * * 1Every Monday at midnight.
0 9 * * 1,4Monday and Thursday at 09:00.
0 9 * * monEvery Monday at 09:00, written with the day name.

The same schedule in four tools

Linux crontab

0 9 * * 1 /path/to/command

Add it with crontab -e. It runs in the machine's time zone.

Kubernetes CronJob

spec:
  schedule: "0 9 * * 1"
  timeZone: "Etc/UTC"
  concurrencyPolicy: Forbid

timeZone is stable from Kubernetes 1.27. Without it, the controller's time zone applies. Forbid stops a new run starting while the last one is still going.

GitHub Actions

on:
  schedule:
    - cron: '0 9 * * 1'

Schedules run in UTC from the default branch, and a run can start a few minutes late when GitHub is busy. Scheduled workflows in public repositories are disabled after 60 days without repository activity.

AWS EventBridge

cron(0 9 ? * MON *)

EventBridge uses six fields, with a question mark in one of the two day fields, and rules run in UTC. Weekday numbers start at Sunday = 1, so names such as MON are safer than numbers.

Questions about every Monday

How do I run on the first Monday of the month?
Cron's rule for the two day fields gets in the way: 0 9 1-7 * 1 would run on days 1 to 7 and also on every Monday. Schedule 0 9 * * 1 and make the command check the date, for example [ "$(date +\%d)" -le 7 ] && /path/to/command. The percent sign must be escaped in a crontab.
Which day does the week start on?
Cron has no week start. It numbers days 0 to 6 from Sunday, so Monday is 1.

Nearby schedules

Scheduling jobs, pipelines and cloud infrastructure is part of my DevOps engineering work.