Cron schedule
Cron every Monday
The cron expression for every Monday is 0 0 * * 1: 00:00 on Monday, once a week. 0 0 * * MON is the same where weekday names are allowed.
| Expression | 0 0 * * 1 |
|---|---|
| Runs | 52 times in 2027 |
| systemd OnCalendar | Mon *-*-* 00:00:00 |
How it works
In the day-of-week field Monday is 1 (Sunday is 0). With the day of month left as *, the only condition is the weekday, so the job fires 52 or 53 times a year.
Monday midnight is a natural boundary for weekly reports, since the previous week has just closed. For something people should see when they arrive, use a morning hour, like 0 8 * * 1. Note that systemd’s weekly keyword also means Monday 00:00, unlike cron’s @weekly, which is Sunday.
The one thing Monday schedules are famous for is the “first Monday of the month” mistake, below. It catches experienced people because the obvious expression parses fine and runs far too often.
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | minute 0 (on the hour) |
| Hour | 0 | hour 0 (12 AM) |
| Day of month | * | every day of the month |
| Month | * | every month |
| Day of week | 1 | Monday |
Next runs
As on GitHub Actions without timezone, Vercel, Cloudflare and Kubernetes with timeZone "Etc/UTC".
| Run | Your time | UTC |
|---|---|---|
| 1 | Calculating… | |
| 2 | ||
| 3 | ||
| 4 | ||
| 5 |
Ready-to-paste versions
The same schedule for each scheduler, with what differs on each one.
crontab (Linux, macOS, BSD)
# m h dom mon dow command
0 0 * * 1 /usr/local/bin/job.sh >> /var/log/job.log 2>&1- cron uses the server’s time zone. On cronie (Fedora, RHEL), a
CRON_TZ=Europe/Londonline above the entry changes the zone for the entries below it.
GitHub Actions
on:
schedule:
- cron: '0 0 * * 1'
# timezone: 'America/New_York' # optional; UTC when omitted
workflow_dispatch: {}- Runs in UTC unless you set
timezone, and only on the default branch. GitHub’s docs warn that scheduled runs can be delayed at busy times and that schedules in public repositories are disabled after 60 days without activity. - The start of every hour is GitHub’s busiest slot. If the exact minute doesn’t matter, move the
0to something like17to get picked up sooner. - With a
timezonethat observes DST, a time skipped by the spring-forward change advances to the next valid time (the docs’ example: 2:30 AM becomes 3:00 AM).
Kubernetes CronJob
apiVersion: batch/v1
kind: CronJob
metadata:
name: scheduled-job
spec:
schedule: "0 0 * * 1"
timeZone: "Etc/UTC"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: job
image: busybox:1.36
command: ["/bin/sh", "-c", "date; echo running"]spec.timeZoneis stable since Kubernetes 1.27; without it, the kube-controller-manager’s zone applies.concurrencyPolicy: Forbidskips a run while the previous Job is still active.
Vercel Cron Jobs
{
"crons": [
{ "path": "/api/cron", "schedule": "0 0 * * 1" }
]
}- Vercel always uses UTC, doesn’t accept names like
MONorJAN, and won’t let you set both day of month and day of week. - This fits the Hobby plan, but Hobby precision is per hour: the invocation can land anywhere within the scheduled hour.
Cloudflare Workers
[triggers]
crons = ["0 0 * * MON"]- Cron Triggers run on UTC. Changes can take up to 15 minutes to propagate across Cloudflare’s network.
- Cloudflare numbers weekdays 1 = Sunday to 7 = Saturday, unlike standard cron, so the example uses names (
MON,SUN), which are unambiguous.
node-cron (Node.js)
import cron from 'node-cron';
// 6 fields: the first one (seconds) is optional
cron.schedule('0 0 0 * * 1', async () => {
await runJob();
}, { timezone: 'UTC', noOverlap: true });- The schedule lives inside the Node process: if it’s down, nothing runs, and three replicas run the job three times.
noOverlapskips a tick while the previous run is still going.
systemd timer
# /etc/systemd/system/job.timer
[Unit]
Description=Run job.service every Monday at midnight
[Timer]
OnCalendar=Mon *-*-* 00:00:00
Persistent=true
[Install]
WantedBy=timers.target
# /etc/systemd/system/job.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/job.sh
# systemctl daemon-reload && systemctl enable --now job.timer- Check it with
systemd-analyze calendar 'Mon *-*-* 00:00:00', which prints the normalized form and the next elapse.AccuracySecdefaults to 1min, so the start can drift by up to a minute. Persistent=trueruns the job at boot if the machine was off at the scheduled time, which plain cron doesn’t do.
Spring @Scheduled and Quartz
@Scheduled(cron = "0 0 0 * * 1", zone = "UTC")
public void runJob() {
// ...
}
// Quartz CronTrigger:
CronScheduleBuilder.cronSchedule("0 0 0 ? * MON")- In Spring, the first of the 6 fields is seconds; the rest follow standard cron (0 or 7 = Sunday).
- In Quartz, one of the two day fields must be
?, and weekdays run 1 = Sunday to 7 = Saturday, which is why the example uses names.
Pitfalls
0 0 1-7 * 1 is not the first Monday of the month
When both day fields are restricted, crontab(5) says the job runs when either matches. That expression runs on days 1 to 7 AND every Monday, 10 or 11 times a month. Use 0 0 1-7 * * with [ "$(date +\%u)" = 1 ] && job.sh, or MON#1 in Spring and Quartz.
Monday 00:00 UTC is Sunday evening in the Americas
On GitHub, Vercel or Cloudflare, 0 0 * * 1 fires at 21:00 Sunday in São Paulo and 19:00 or 20:00 Sunday in New York. Weekly jobs that should run “Monday morning” need a later UTC hour.
1 is Sunday in Quartz and Cloudflare
Both number weekdays from 1 = Sunday, so 1 there means Sunday. Write MON.
Frequently asked questions
- What is the cron expression for every Monday?
- 0 0 * * 1 runs at midnight every Monday. 0 0 * * MON is equivalent where names are supported.
- How do I run a cron job every Monday at 9 AM?
- 0 9 * * 1.
- How do I run on the first Monday of the month?
- Standard cron can’t express it in one field. Run 0 0 1-7 * * and check that date +%u is 1 inside the job (escape % as \% in crontab). Spring and Quartz support MON#1, and systemd supports Mon *-*-01..07.
- Is Monday 1 or 2 in cron?
- In standard cron, Monday is 1. In Quartz and Cloudflare Workers, Monday is 2 because they count Sunday as 1.
Last reviewed by Arielton Oberek.