FULL AI ANALYSIS

Cron jobs consistently missed after system clock steps backwards due to NTP slewing

Generated Oct 3, 2026, 12:35:03 AM

Analysis summary

Traditional cron uses wall-clock time to determine when jobs should run; when the kernel clock moves backwards, cron's internal next-run calculation can result in the scheduled time being in the past relative to the adjusted clock and thus skipped. systemd timers offer better guarantees (Persistent=true) because they record missed runs and trigger on boot. For time corrections, choosing between slewing and stepping affects whether tasks miss runs: slewing slowly shifts time and can still produce missed events depending on timing. Ensuring jobs are resilient to clock adjustments is the safer approach.

Possible causes

Cron's scheduling logic evaluates 'next runtime' against the adjusted wall clock and doesn't backfill jobs when time moves backward

90%

Large slewing operations change the wall clock across the scheduled instant so cron does not see the job slot as expired/runnable

85%

Use of cron for jobs that must not be skipped across time corrections rather than using persistent systemd timers or at-job tracking

80%

Suggested fixes

1

Diagnostic step 1

Convert critical scheduled tasks to systemd timers with Persistent=true so missed runs due to clock jumps are executed when the system stabilizes.

2

Diagnostic step 2

Configure chrony to step the clock for large corrections during maintenance windows (use makestep for corrections larger than a threshold) or set acceptable precision limits to reduce large slews during production hours.

3

Diagnostic step 3

For cron-managed jobs that must not be skipped, add an idempotent wrapper that checks if expected outputs exist for a recent interval and runs the job if missing (this preserves reversibility and avoids changing system time behavior).

4

Diagnostic step 4

Instrument logging: enable more verbose cron logging and check /var/log/syslog and /var/log/chrony/chronyd.log to correlate time corrections with missed jobs; if time server reliability is the root cause, escalate to infrastructure/NTP server administrators.