Developer Toolbox

Cron: every week

Midnight at the start of Sunday, once a week. @weekly is the same expression, and 0 0 * * 7 is too, since both 0 and 7 mean Sunday.

Open in Cron Parser The expression is filled in: change it and watch the next runs.

Expression

0 0 * * 0
Meaning

At 00:00 on Sunday

Next 5 runs

Your time zone

The same schedule on other platforms

PlatformWritten asNote
Linux crontab0 0 * * 0Five fields, in the server's local time zone. A % in the command has to be escaped as \%.
GitHub Actions- cron: '0 0 * * 0'Five fields, in UTC unless a timezone (an IANA name such as Europe/Warsaw) is set next to cron. Default branch only. The shortest interval is 5 minutes; when GitHub is busy, runs start late and some are dropped.
Kubernetes CronJobschedule: "0 0 * * 0"Five fields, in the controller's time zone unless spec.timeZone is set (Kubernetes 1.27 and later). concurrencyPolicy decides what happens when runs overlap.
systemd timerOnCalendar=Sun 00:00Not weekly: in systemd that means Monday at 00:00.
AWS EventBridgecron(0 0 ? * SUN *)Six fields, the last one the year; one day field must be ?, and day of week 1 is Sunday. Rules run in UTC; EventBridge Scheduler accepts a time zone.
Quartz / Spring0 0 0 ? * SUNSix fields, seconds first. Quartz needs ? in one of the day fields and counts Sunday as 1; Spring accepts ? and numbers days like cron.

Common mistakes

  • systemd's weekly is Monday

    cron's @weekly runs on Sunday, while systemd's OnCalendar=weekly runs on Monday. Moving a job from one to the other shifts it by a day unless you write the day out.

  • A week that starts on Monday

    Use 0 0 * * 1 for Monday at 00:00, the start of the week in most of Europe and in ISO 8601.

  • At the end of the week

    Midnight at the start of Sunday is also the last moment of Saturday. For a job that closes the week on Sunday evening, 0 23 * * 0 (Sunday 23:00) is often what people mean; for Saturday night, 0 23 * * 6.