Twice a Week Cron Expression
Runs Monday and Thursday at midnight.
0 0 * * 1,4 in POSIX cron
Expression
0 0 * * 1,4Try it in the tester →Field Breakdown
How It Works
Day-of-week list `1,4` — fires twice per week at 00:00, on Monday and Thursday (roughly evenly spaced).
Example Run Times
- Mon 00:00:00
- Thu 00:00:00
- Mon 00:00:00 (+7d)
- Thu 00:00:00 (+7d)
- Mon 00:00:00 (+14d)
Frequently Asked Questions
Can I pick different days?
Yes — replace `1,4` with any two day numbers (0=Sun, 1=Mon, …, 6=Sat). Tue/Fri would be `2,5`, for example.
0 0 * * 1,4 in Quartz / Spring
Two midnight firings per week, on Monday and Thursday. The day-of-week value 2-5/3 looks exotic but unpacks simply: start at 2 (Monday in Quartz's Sunday-first week), step by 3, stay within 5 — which selects exactly days 2 and 5.
Quartz / Spring expression
0 0 0 ? * 2-5/3Try it in the tester →At 00:00:00 on Mon, Thu
Unix / POSIX equivalent: 0 0 * * 1,4
@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
A Monday/Thursday split carves the week into a three-day and a four-day stretch, about as even as two weekly slots can get — handy for twice-weekly database maintenance, a newsletter that shouldn't feel like spam, or syncs against a partner who publishes data early and mid-week. Spring takes it via @Scheduled(cron = "0 0 0 ? * 2-5/3"); Quartz parses it identically. Most humans will find the equivalent list spelling 2,5 (or MON,THU) far easier to verify at a glance, and Quartz treats all three forms as the same schedule.
Quartz-Specific Notes
- →Range-with-step arithmetic: from 2, adding 3 gives 5; adding 3 again gives 8, which exceeds the range bound, so matching stops. The expression can never fire on any day besides Monday and Thursday.
- →The two gaps are asymmetric — Monday to Thursday is 72 hours, Thursday back to Monday is 96. A job computing "changes since last run" must handle both window sizes.
- →This was machine-converted from the Unix list 1,4; both the numbering shift (Monday 1 to 2, Thursday 4 to 5) and the compaction into step form happened in conversion.
Frequently Asked Questions
How does 2-5/3 end up meaning just two days?
A step inside a range enumerates from the range start: 2, then 2+3=5, then 8 which falls outside 2-5. Only 2 (Monday) and 5 (Thursday) survive. It's exactly equivalent to writing 2,5 or MON,THU.
I'd rather run Tuesday and Friday — what changes?
Swap the day field for an explicit list: 0 0 0 ? * 3,6 (Tuesday is 3, Friday is 6 under Quartz's Sunday=1 convention). The step trick isn't worth preserving once the days change.
0 0 * * 1,4 in AWS EventBridge
Monday and Thursday at 00:00 UTC, 104 runs a year. The day-of-week field uses range-with-step syntax: 2-5/3 starts at 2 (Monday in EventBridge's Sunday-first week) and steps by 3 within the range, matching only 2 and 5 — Monday and Thursday.
AWS EventBridge expression
cron(0 0 ? * 2-5/3 *)Try it in the tester →At 00:00 UTC on Mon, Thu
Unix / POSIX equivalent: 0 0 * * 1,4
Field Breakdown
Using It with AWS EventBridge
Twice-weekly is the cadence for upkeep that goes stale in a week but doesn't justify daily runs: dependency-vulnerability scans whose findings feed a twice-weekly triage, refreshing staging databases from sanitized production snapshots so testers never work against data more than four days old, or re-fetching third-party reference datasets published on an irregular weekly-ish schedule. Set the expression on a rule and target the job's Lambda or ECS task; both weekly fires share one rule, one target, and one CloudWatch metric stream.
AWS-Specific Notes
- →2-5/3 is exactly equivalent to the list 2,5 and to the names MON,THU — the list forms are far easier to verify at review time and worth substituting in hand-written templates.
- →The cadence is inherently lopsided: three days from Monday to Thursday, four days from Thursday back to Monday — no two-per-week pattern on a seven-day calendar can be even.
- →The POSIX source 0 0 * * 1,4 encodes the same days; copying those numbers into EventBridge unchanged would silently shift the runs to Sunday and Wednesday.
Frequently Asked Questions
What does the /3 in 2-5/3 actually do?
It steps through the range starting at its low end: from 2, adding 3 stays within 2-5 only once more, at 5. The result is the two-element set {2,5}, i.e. Monday and Thursday.
How do I shift this to Tuesday and Friday?
Use an explicit list rather than bending the step syntax: cron(0 0 ? * 3,6 *), since Tuesday is 3 and Friday is 6 in EventBridge numbering. TUE,FRI works identically.
0 0 * * 1,4 in GitHub Actions
Monday and Thursday at 00:00 UTC — a day-of-week list giving 104 runs a year, split into alternating 3-day and 4-day gaps. Mon/Thu is the closest a week of seven days comes to an even two-way split, which is why it is the default answer to "twice a week."
GitHub Actions expression
0 0 * * 1,4Try it in the tester →At 00:00 UTC on Mon, Thu
Unix / POSIX equivalent: 0 0 * * 1,4
Field Breakdown
Using It with GitHub Actions
Authored as on: schedule: - cron: "0 0 * * 1,4" in the default branch's workflow file, the twice-weekly beat fits work where weekly is too slow and daily too chatty: vulnerability scans that should catch issues within a few days, refreshing staging databases so they never drift more than half a week from production, or posting backlog summaries ahead of Monday planning and Thursday review. The Monday tick covers everything since Thursday — a 96-hour window — while Thursday only covers 72 hours, so a job that processes "what happened since last run" should measure from the previous run, not assume a fixed lookback.
GitHub-Specific Notes
- →The list 1,4 selects Monday and Thursday under Sunday = 0 numbering; MON,THU spells the same schedule with no numbering to second-guess.
- →Intervals alternate 72 and 96 hours — any hardcoded since-last-time window of 3.5 days will double-count after one gap and miss data after the other.
- →Both ticks at 00:00 UTC translate to Sunday and Wednesday evenings in the Americas, so US-hours systems see this as an evening job on different days than the cron line suggests.
Frequently Asked Questions
How do I make it Tuesday and Friday instead?
Swap the list values: 0 0 * * 2,5. Any pair works the same way; pairs three days apart (like 2,5 or 1,4) keep the spacing as even as a seven-day week allows.
Can I get perfectly even spacing instead of 3 and 4 day gaps?
Yes, with two entries in the schedule list: - cron: "0 0 * * 1" plus - cron: "0 12 * * 4" fires Monday midnight and Thursday noon UTC — exactly 84 hours apart in both directions. Inside the job, github.event.schedule tells you which line fired.