Why */14 in Cron Does NOT Run Every Two Weeks (True Biweekly 14-Day Schedule)

Understand why 0 9 */14 * * resets at every month boundary (running on the 29th AND the 1st), and implement true 14-day biweekly cadence with epoch arithmetic.

POSIX.1-2017 crontab Step Values (Field-Local Modulo Expansion)Unix Epoch Day Modulo Arithmetic (86400s UTC Days)

Incident Symptom & Protocol Root Cause

Production Failure Symptom

A team configures 0 9 */14 * * or 0 9 */14 * 1 for biweekly sprint rollovers or two-week on-call rotations, only to see the job run on January 1, January 15, January 29, and then again THREE days later on February 1!

Scheduler Parser & Clock Mechanics

In every cron implementation, */N is purely syntactic sugar for stepping through the allowed integers of that single field starting from its minimum value: in Day-of-Month (1–31), */14 expands literally to the static list 1,15,29 regardless of month length, resetting to day 1 on every new month! Worse, 0 9 */14 * 1 triggers the DOM/DOW OR trap and runs every Monday plus days 1, 15, and 29!

Broken vs Verified Configuration

BrokenTwo Classic 'Biweekly' Cron Bugs
# Bug 1: Expands to static days 1, 15, 29 of EVERY month!
# Fires Jan 29 -> Feb 1 (only 3 days apart!), and never hits Mondays consistently!
0 9 */14 * * /opt/ops/rotate-sprint.sh

# Bug 2: POSIX OR trap! Runs days 1, 15, 29 PLUS every single Monday!
0 9 */14 * 1 /opt/ops/rotate-sprint.sh
Verified FixTrue Every-Other-Monday (14-Day Epoch Modulo Guard)
# Linux / POSIX crontab: wakes every Monday at 09:00 UTC, runs on even 14-day cycles!
# 86400s = 1 UTC day; Unix epoch 1970-01-01 was Thursday; divide by 7 or 14 days:
0 9 * * 1 [ $(( ($(date -u +%s) / 86400 / 7) % 2 )) -eq 0 ] && /opt/ops/rotate-sprint.sh

# Flip '= 0' to '= 1' if your biweekly cadence starts on the opposite Monday!

# Kubernetes / GitHub Actions run command (no % escaping needed outside crontab):
# [ $(( ($(date -u +%s) / 604800) % 2 )) -eq 0 ] || exit 0
# /opt/ops/rotate-sprint.sh

Operational Deep Dive

Cron expressions are stateless calendar-field matchers with zero memory of when a job last ran. Because months have 28, 29, 30, or 31 days—none of which is an integer multiple of 14 except non-leap February—no pure 5-field POSIX cron string can represent an unbroken 14-day cycle across month boundaries.

Using Unix epoch seconds in UTC (date -u +%s) provides a stateless, globally synchronized 14-day clock across every server and container in your fleet without needing shared database state! Dividing UTC epoch seconds by 604800 (the exact number of seconds in 7 UTC days: 7 * 86400) yields an integer week number since 1970-01-01 that increments by 1 every Thursday at 00:00:00 UTC. Checking (% 2 -eq 0) inside a Monday cron rule (0 9 * * 1) guarantees the condition is true on alternate Mondays forever across month ends, year ends, and leap years!

Notice why date -u +%s (or integer division at a fixed UTC hour away from Thursday 00:00 UTC rollover, or anchoring to an explicit reference date (epoch - ref_epoch) / 86400 % 14 == 0) is rock solid: Unix timestamps never jump forward or backward during local Daylight Saving Time transitions. If your cron fires on Monday at 09:00 America/New_York (13:00 or 14:00 UTC), integer-dividing UTC epoch seconds by 604800 lands squarely on day 4 of the epoch week in both winter and summer.

Stepped Cron Myths vs Reality

Engine / CaseRuntime BehaviorProduction Remediation
0 9 */14 * *Expands to DOM = 1, 15, 29; gap shrinks to 3 days between Jan 29 and Feb 1.Wake weekly on target weekday (0 9 * * 1) + epoch week parity check ((epoch / 604800) % 2 == 0).
0 0 */2 * *Expands to odd days 1,3,5..31; runs TWO days in a row on Jan 31 and Feb 1!Wake daily (0 0 * * *) and guard with [ $(( ($(date -u +\%s) / 86400) \% 2 )) -eq 0 ].
Semi-monthly (24x/year vs Biweekly 26x/year)0 9 1,15 * * runs 24 times/year on fixed dates (1st & 15th), NOT every 14 days.Confirm with finance/ops whether business logic expects semi-monthly (1,15) or biweekly (26x/yr).
AWS EventBridge rate(14 days)Fires every 14*24h relative to rule creation/update time (drifts if Terraform recreates rule!).Pin deterministic anchor date in code or use EventBridge Scheduler start_date + rate(14 days).

Edge Cases & Engineering FAQs

Why shouldn't I just use AWS EventBridge rate(14 days) for biweekly Monday jobs?

In legacy EventBridge Rules, rate(14 days) starts counting from the exact timestamp the rule was created or modified—if someone runs terraform apply on a Wednesday afternoon, your Monday payroll schedule silently shifts to alternate Wednesdays! In EventBridge Scheduler, pair rate(14 days) with an explicit StartDate anchored to Monday 09:00, or use cron(0 9 ? * MON *) with an epoch parity check inside Lambda.

Does */2 in the Month field have the same wrap bug?

Months always run 1..12 (an even 12 months), so 0 0 1 */2 * expands cleanly to Jan, Mar, May, Jul, Sep, Nov (every 2 months without Dec->Jan collision). Odd steps like */5 in Month DO collide (1, 6, 11 -> then Jan 1 is 2 months after Nov 1).

How do I pick which of the two Mondays matches my team's current sprint?

Run echo $(( ($(date -u +%s) / 604800) % 2 )) on a Monday that belongs to an active sprint end: if it prints 0, test -eq 0; if it prints 1, test -eq 1.

Runtime Dead-Man's-Switch Verification

Heartbeat & Cron MonitoringBetter Stack →

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.