Monitoring for the batch that never ran
One-line answer: Heartbeats, lateness alerts and drift detection: how to notice a job that fails silently.
The most dangerous batch failure is the one with no error. If the scheduler never starts the job, there is no stack trace and often no alert. You need to watch “did it run?” separately from “did it succeed?”.
Heartbeats
Send a signal to a monitoring service whenever the job finishes. The monitor alerts when the last signal is older than 1.5–2 times the expected interval: for an hourly job, warn after 90 minutes without a signal. Long jobs should send a start signal and an end signal separately.
# last line of the job
curl -fsS -m 10 https://monitor.example.com/ping/nightly-report || echo "heartbeat failed" >&2
Lateness and drift
Record the gap between the scheduled time and the actual start. A growing gap points to scheduler load, a previous run that never finished, or a backlog. Watch duration as well as start time: when duration exceeds about 80% of the interval, the next run will collide.
Reducing alert fatigue
- Deduplicate repeated failures into one alert.
- Alert immediately for user-facing jobs, summarise internal housekeeping.
- Send a recovery notice so people know it is over.
Daylight saving and monitoring
DST days are 23 or 25 hours long. A monitor that assumes “once a day” will false-alarm twice a year. Separate interval-based heartbeats from calendar-based checks and relax thresholds on transition days.
| Check | Threshold | Alert |
|---|---|---|
| End heartbeat | 1.5-2x the interval | no signal |
| Start lateness | scheduled +30 min | late warning |
| Consecutive failures | 3 | escalation |
The minimum set
If full coverage is too much, start with three things: an end-of-job heartbeat for critical jobs, an alert when a run is 30 minutes late, and an escalation after three consecutive failures. That catches most silent batch outages.
Paste an expression and see its next run times right away.
Open CronPulseFrequently asked questions
Where should the heartbeat go?
To a monitoring service or an internal endpoint, ideally outside the same failure domain as the job. The point is that the absence of a signal is itself the alert.
How do I monitor a job with irregular runtime?
Send both start and end signals and alert when the end signal does not arrive within a duration threshold. Base the threshold on recent percentiles rather than a fixed number.
Sources
Related reading
- Cron in five fields: minute, hour, day, month, weekdayWhat each of the five Unix cron fields means, which values are allowed, and how to read an expression without guessing.
- Cron special characters: *, /, -, commas, ?, L, W and #The eight symbols that make cron expressive, what each one means, and where implementations disagree.
- Five-field Unix cron versus six-field Quartz and EventBridgeSeconds, weekday numbers, the ? rule and the year field: what changes when you move a schedule between cron dialects.
- Daylight saving and cron: the day 02:30 disappearsHow clock changes affect cron runs, and how to move jobs out of the 2–3 AM danger window.