Every week cron: what @weekly means and where the macro is not supported
Runs in your browser — nothing you paste leaves this page. How we prove that
Cron Expression Tester playground
Five fields — minute, hour, day of month, month, day of week. Macros like @daily are supported too.
Results update as you type — press Enter to run now.
At 00:00, on Sunday.
- Computed in your browser, in your timezone.
`@weekly` is shorthand for `0 0 * * 0`, a run at midnight at the start of Sunday. The engine expands it and reads it as: At 00:00, on Sunday.
What the macro expands to
Vixie cron introduced a handful of named schedules that replace the five fields: @yearly, @monthly, @weekly, @daily, @hourly and @reboot. @weekly is defined as 0 0 * * 0: minute 0, hour 0, any day of month, any month, day of week 0, which is Sunday. Writing the five fields out gives exactly the same schedule.
This page's parser expands the macro before describing it, which is why its reading is: At 00:00, on Sunday. The next run times in the panel above are computed in your browser, in your own timezone, so they are not printed in this text.
Where @weekly works and where it does not
Cronie and Vixie cron (the cron on most Linux distributions) and Kubernetes CronJobs accept the macro. GitHub Actions does not: its documentation lists the @ shorthands as unsupported, so a workflow needs cron: '0 0 * * 0'. Some minimal crons in embedded systems and small container images do not understand macros either. The five-field form is the portable one; the macro is easier to read.
systemd timers have their own shorthand OnCalendar=weekly, and it is not the same schedule: systemd defines it as Mon *-*-* 00:00:00, Monday at midnight. Porting a crontab line to a timer by name silently moves the job by a day; write OnCalendar=Sun *-*-* 00:00:00 to keep cron's meaning.
Example and pitfalls
@weekly /usr/sbin/fstrim -av is a classic weekly housekeeping line. Midnight on Sunday is when a lot of other weekly jobs also run, and in the server's zone, which on a cloud host is often UTC rather than the team's local time. Long weekly jobs should take a lock (flock -n /run/lock/fstrim.lock) and report their exit status, because a weekly failure can go unseen for a long time.
Plain cron does not catch up: if the host is off at midnight on Sunday, that week's run is lost. anacron, or a systemd timer with Persistent=true, runs it at the next boot instead.
Related schedules
If the job should run in working hours, every Sunday at 09:00 or every Monday at 09:00 are the common alternatives. @monthly and @yearly are the next macros up; @daily (also spelled @midnight) is the one below.
FAQ
Questions, answered.
Tap a question to expand the answer.
Is @weekly Sunday or Monday?
In cron, @weekly is Sunday at 00:00 (0 0 * * 0). In systemd, OnCalendar=weekly is Monday at 00:00, so the two shorthands differ by a day.
Can I use @weekly in a GitHub Actions schedule?
No. GitHub Actions rejects the @ shorthands; use the equivalent five-field expression 0 0 * * 0, which runs at 00:00 UTC on Sunday.
More free, private DevOps tools.
The Cron Expression Tester is one tool in OpsCanopy — a growing canopy of browser-based validators, converters and testers that never touch a server.
More in Scheduling
Read more about this
- GitHub Actions cron runs in UTC: convert your schedule and check the real next run time GitHub Actions cron timezone UTC explained: why schedule: cron: always fires on UTC, how DST shifts the wall-clock time, and how to check the real next run.
- Reading cron expressions: a field-by-field guide A field-by-field guide to reading cron expressions — the five time fields, ranges, steps, lists and @macros — plus the gotchas that misfire schedules.
New to Linux? Read the Linux guide →
42 free tools, every one offline-capable — opscanopy.com works with no signup and nothing uploaded.
Scheduling on Linux? Pair this with the Cron to systemd Converter, or browse the full tools directory.
Not affiliated with or endorsed by any cron implementation. Format names are used only to describe what this tool reads. OpsCanopy is free and open.