Cron expression for every Sunday at 2 AM

0 2 * * 0

The job runs once a week, at 02:00 on Sunday, when most systems are quiet.

Runs when: minute 0; hour 2; every day of month; every month; on Sun.

Change it in the cron expression generator

How the five fields read

FieldValueReads as
Minute0at 0
Hour2at 2
Day of month*every value
Month*every value
Day of week0at Sunday

The next five runs

What people use it for

The daylight saving hour that does not exist

In the US and across Europe the clocks jump forward on a Sunday morning, and in many places 02:00 to 03:00 is the hour that is skipped. A job set for local 02:00 may not run that week, or may run late. Either run the scheduler in UTC, which has no daylight saving, or choose an hour that always exists in your zone.

Variations of every Sunday at 2 AM

ExpressionWhat it does
0 3 * * 0Sunday at 03:00, after the daylight saving gap.
0 2 * * 6Saturday at 02:00.
0 2 * * sunSunday at 02:00, written with the day name.

The same schedule in four tools

Linux crontab

0 2 * * 0 /path/to/command

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

Kubernetes CronJob

spec:
  schedule: "0 2 * * 0"
  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 2 * * 0'

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 2 ? * SUN *)

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 Sunday at 2 AM

Is Sunday 0 or 7?
Vixie cron accepts both, but some implementations only accept 0, so 0 is the safer choice.
How do I run it in UTC when the server is not on UTC?
Set CRON_TZ=UTC at the top of the crontab if your cron supports it, or convert the hour by hand. On a Kubernetes CronJob, set spec.timeZone.

Nearby schedules

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