Run a Cron Job Every 90 Minutes or Every 45 Minutes (Cross-Hour Split Pattern)
Why */90 and */45 fail to produce uniform cross-hour intervals in cron, and how to split 45-minute and 90-minute schedules into exact dual cron expressions.
Incident Symptom & Protocol Root Cause
Production Failure Symptom
Writing */90 * * * * fails immediately with 'bad minute' (since minutes cap at 59), while writing */45 * * * * executes at :00, :45, and then AGAIN 15 minutes later at :00 of the next hour (producing an uneven 45m / 15m / 45m / 15m sawtooth pattern!).
Scheduler Parser & Clock Mechanics
Cron minute steps reset to 0 at every hour boundary unless 60 is evenly divisible by N (only 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, and 30 divide 60 evenly!). Any interval whose least common multiple with 60 spans multiple hours (such as 45m -> 3h cycle, or 90m -> 3h cycle) must split across multiple cron lines grouped by hour residue.
Broken vs Verified Configuration
# ERROR: 90 exceeds minute field maximum (0-59) -> rejected by crontab!
*/90 * * * * /opt/sync/incremental-pull.sh
# SILENT BUG: Fires at 00:00, 00:45, 01:00 (15m gap!), 01:45, 02:00 (15m gap!)
*/45 * * * * /opt/sync/incremental-pull.sh# === Exact Every 90 Minutes (16 uniform runs/day: 00:00, 01:30, 03:00, 04:30 ... 22:30) ===
0 0-21/3 * * * /opt/sync/incremental-pull.sh
30 1-22/3 * * * /opt/sync/incremental-pull.sh
# (In POSIX crontabs without range-step 0-21/3, use explicit hours:)
# 0 0,3,6,9,12,15,18,21 * * * /opt/sync/incremental-pull.sh
# 30 1,4,7,10,13,16,19,22 * * * /opt/sync/incremental-pull.sh
# === Exact Every 45 Minutes (32 uniform runs/day across 3-hour LCM cycle) ===
0,45 0,3,6,9,12,15,18,21 * * * /opt/sync/incremental-pull.sh
30 1,4,7,10,13,16,19,22 * * * /opt/sync/incremental-pull.sh
15 2,5,8,11,14,17,20,23 * * * /opt/sync/incremental-pull.shOperational Deep Dive
Whenever you need an exact every-M-minutes schedule in standard cron, compute LCM(M, 60) to find when the minute offset realigns to :00—and confirm that 1440 (the number of minutes in a 24-hour UTC day) is also divisible by M so midnight does not introduce a seam! Both 90 minutes (1440 / 90 = 16 runs/day, LCM = 180m = 3 hours) and 45 minutes (1440 / 45 = 32 runs/day, LCM = 180m = 3 hours) tile a 24-hour UTC day with zero drift!
Look at how cleanly the 3-hour cycle decomposes for 90 minutes: in hours congruent to 0 mod 3 (0, 3, 6, 9, 12, 15, 18, 21), the job fires at :00; 90 minutes later lands in hours congruent to 1 mod 3 (1, 4, 7, 10, 13, 16, 19, 22) at :30; and 90 minutes after :30 lands in the next 0-mod-3 hour at :00! Hours congruent to 2 mod 3 (2, 5, 8...) contain zero runs. Two cron entries therefore express a mathematically exact 90-minute schedule across every cron dialect on earth (POSIX, GitHub Actions, Kubernetes, EventBridge, and Cloudflare Workers).
Crucially, run cross-hour split schedules in UTC (not a DST-observing local timezone): during spring forward or fall back, a 23-hour or 25-hour local day breaks 3-hour modulo continuity at 02:00. Alternatively, on Linux systemd or AWS EventBridge, monotonic interval timers (OnUnitActiveSec=90min in systemd or rate(90 minutes) in EventBridge) express arbitrary non-60-divisor intervals in a single line.
Divisor Rule for */N Minute Cron Expressions
| Engine / Case | Runtime Behavior | Production Remediation |
|---|---|---|
| N divides 60 (1,2,3,4,5,6,10,12,15,20,30) | */N * * * * produces completely uniform N-minute intervals across every hour. | Single cron rule works natively with zero hour-boundary sawtooth. |
| Every 40 minutes (LCM=120m, 2h cycle) | */40 fires at :00, :40, :00 (40m then 20m gap!). | Split into 2 lines: '0,40 */2 * * *' (even hours) and '20 1-23/2 * * *' (odd hours) in UTC. |
| Every 45 minutes (LCM=180m, 3h cycle) | */45 fires at :00, :45, :00 (45m then 15m gap!). | Split into 3 lines across hours mod 3 (:00,:45 on h%3==0; :30 on h%3==1; :15 on h%3==2). |
| Every 90 minutes (LCM=180m, 3h cycle) | */90 is a syntax error (max minute is 59). | Split into 2 lines: '0 0,3,6,9,12,15,18,21 * * *' and '30 1,4,7,10,13,16,19,22 * * *' in UTC. |
Edge Cases & Engineering FAQs
Can I express every 7 minutes or every 25 minutes cleanly with split cron lines?
No, because neither 7 nor 25 divides 1440 (minutes in a day), so midnight UTC would always create an uneven gap even if you wrote 24 separate lines! For non-divisors of 1440, trigger * * * * * (every minute) with a lightweight epoch guard [ $(( ($(date -u +\%s) / 60) \% 25 )) -eq 0 ] or use systemd OnUnitActiveSec=25min / EventBridge rate(25 minutes).
Is 1-22/3 portable across all cron parsers?
Vixie Cron, Cronie, Kubernetes robfig/cron, and GitHub Actions all support range-with-step (1-22/3), whereas a few strict legacy SysV parsers reject steps on ranges—writing the explicit list 1,4,7,10,13,16,19,22 is short and 100% universally portable.
If I split a job across two Kubernetes CronJob objects (:00 and :30), can they overlap?
Two separate Kubernetes CronJob objects do NOT share concurrencyPolicy state! If a run can ever exceed 90 minutes, add a distributed DB advisory lock or combine into an hourly/30m CronJob with an internal modulo check so one CronJob controller enforces concurrencyPolicy: Forbid.
Runtime Dead-Man's-Switch Verification
Dead-man's-switch heartbeat checks that page on-call when a scheduled job skips a DST gap, stalls on a lock, or exits non-zero.