Every Week Cron Expression
Runs once per week — Sundays at midnight.
0 0 * * 0 in POSIX cron
Expression
0 0 * * 0Try it in the tester →Field Breakdown
How It Works
Day-of-week pinned to 0 (Sunday) — fires once per week at 00:00 on Sunday.
Example Run Times
- Sun 00:00:00
- Sun 00:00:00 (+7d)
- Sun 00:00:00 (+14d)
- Sun 00:00:00 (+21d)
- Sun 00:00:00 (+28d)
Frequently Asked Questions
Is this the same as `@weekly`?
Yes — `@weekly` expands to `0 0 * * 0`.
0 0 * * 0 in Quartz / Spring
One firing per week — 00:00 on Sunday, the day Quartz numbers 1 because its week starts on Sunday rather than Monday. That works out to 52 runs in most years, 53 when the calendar squeezes in an extra Sunday.
Quartz / Spring expression
0 0 0 ? * 1Try it in the tester →At 00:00:00 on Sun
Unix / POSIX equivalent: 0 0 * * 0
@Scheduled parser uses 0–7 with Monday = 1 — numeric day values mean different days in the two. The day names (MON, FRI, MON-FRI) are identical in both and safer to copy between them.Field Breakdown
Using It with Quartz / Spring
Weekly is the cadence for state that resets on a week boundary: usage counters that feed weekly quotas, rollup tables that power week-over-week dashboards, or pruning jobs that keep only the last N weeks of data. Spring picks it up via @Scheduled(cron = "0 0 0 ? * 1"); standalone Quartz builds a CronTrigger from the same string. Since the next natural slot after a missed firing is seven days out, decide consciously whether a missed week should be made up on restart or skipped — don't leave that to whatever the default happens to do for your trigger.
Quartz-Specific Notes
- →Sunday midnight is the boundary between Saturday and Sunday — weekly aggregates produced here cover the previous seven days, Sunday through Saturday, plus however you attribute the boundary instant.
- →To anchor the week somewhere else, replace the 1: 0 0 0 ? * 2 starts weeks on Monday, 0 0 0 ? * 7 on Saturday. The day names SUN through SAT work in place of any number.
- →The ? occupies day-of-month because the rule is weekday-driven; flipping the two would silently turn this into a monthly date-based schedule.
Frequently Asked Questions
Does Spring's @weekly macro give me the same schedule?
Spring 5.3+ accepts @weekly and it fires at the same Sunday-midnight instants. Note that Spring expands macros with its own parser, which doesn't use the ? token — and plain Quartz CronExpression rejects macro strings outright.
I want the weekly run on Monday morning, not Sunday night — what changes?
Two fields: 0 0 6 ? * 2 fires at 06:00 every Monday. Hour moves to 6, day-of-week moves to 2 (Monday in Quartz's Sunday-first week).
How many times will this fire in a year?
Once per Sunday: 52 times in most years, 53 in years containing 53 Sundays (which happens when January 1 falls on a Sunday, or on a Saturday in a leap year).
0 0 * * 0 in AWS EventBridge
Fifty-two runs a year: this expression pins day-of-week to 1, which in EventBridge numbering is Sunday, and fires at 00:00 UTC as each new week begins. It is the natural cadence for anything summarized or reset on a weekly boundary.
AWS EventBridge expression
cron(0 0 ? * 1 *)Try it in the tester →At 00:00 UTC on Sun
Unix / POSIX equivalent: 0 0 * * 0
Field Breakdown
Using It with AWS EventBridge
Weekly EventBridge rules commonly drive digest emails covering the previous seven days, IAM access-key age audits, Cost Explorer report generation, and cleanup jobs that prune week-old build artifacts from S3. Supply the string as the ScheduleExpression and target a Lambda, or target an SQS queue if several consumers should each react to the weekly tick at their own pace. The week your job perceives starts at Sunday 00:00 UTC, so a previous-week query should cover the preceding Sunday-to-Saturday span in UTC terms.
AWS-Specific Notes
- →EventBridge counts weekdays from Sunday=1 through Saturday=7; the POSIX source 0 0 * * 0 says Sunday with a 0, which has no meaning in this dialect.
- →Writing SUN instead of 1 is accepted and survives code review better: cron(0 0 ? * SUN *).
- →A weekly cadence amplifies the cost of a missed run — at-least-once delivery makes silent skips extremely unlikely, but a dead-letter queue on the target catches the case where the target itself fails.
Frequently Asked Questions
How do I start the week on Monday instead?
Set day-of-week to 2 or MON: cron(0 0 ? * 2 *). Remember the value is one higher than the Linux cron convention, where Monday is 1.
What happens if my weekly Lambda errors out — does EventBridge retry?
EventBridge delivers the event and the Lambda service applies its own asynchronous retry policy, two retries by default. After that the invocation is lost unless you configured a dead-letter queue or Lambda destination, which is worth doing for a job that only gets one chance a week.
0 0 * * 0 in GitHub Actions
Day-of-week pinned to 0 gives one run per week, at 00:00 UTC as Sunday begins. Cron's week starts at Sunday = 0, so this is the most literal spelling of "weekly" the 5-field syntax has.
GitHub Actions expression
0 0 * * 0Try it in the tester →At 00:00 UTC on Sun
Unix / POSIX equivalent: 0 0 * * 0
Field Breakdown
Using It with GitHub Actions
As on: schedule: - cron: "0 0 * * 0" in a default-branch workflow, the weekly tick fits work scoped to a calendar week: assembling a changelog of everything merged Monday through Saturday, regenerating a weekly contributors report from the API, or opening the next week's planning issue. Firing at the Saturday-to-Sunday boundary means the run summarizes a fully completed week before anyone starts the next one — at least in UTC terms.
GitHub-Specific Notes
- →The anchor day is arbitrary from cron's perspective — change the final field to move the weekly run to any day, 1 for Monday through 6 for Saturday, without touching the rest of the expression.
- →Sunday 00:00 UTC is Saturday evening across the Americas, so a "start of week" job reads as an end-of-weekend job to US-based contributors.
- →Most years contain 52 Sundays, but some contain 53 — a yearly rollup that assumes exactly 52 weekly runs will occasionally be off by one.
Frequently Asked Questions
How do I move this weekly run to Wednesday?
Change the day-of-week field: "0 0 * * 3" fires at 00:00 UTC every Wednesday. The hour and minute fields are independent, so you can shift the time of day in the same edit.
If one Sunday's run is delayed, does the following week's run shift too?
No. Each tick is matched against the UTC clock independently — a run that started late on one Sunday has no effect on when the next Sunday's tick is attempted.