How to tell when a cron job silently stops running
A cron job that fails loudly is easy. A cron job that stops running at all is the one that costs you three weeks of backups.
Why cron failures are silent
Cron emails output to the local user by default. On most servers nothing is configured to deliver that mail, so it lands in /var/mail and is never read. Worse, these common failures produce no output at all:
- The crontab entry was removed by a config-management run or a server rebuild.
- The user's crontab survived but their shell,
PATH, or virtualenv didn't — the command exits 127 and the output goes nowhere. - The machine is up and healthy; the scheduler itself was never restarted after a kernel upgrade.
- The container running the job was rescheduled and its sidecar cron never started.
- The job is still running from the previous invocation and overlapping runs are being skipped.
In every one of those cases your uptime monitor stays green, because nothing is down. The absence of an event is not an event.
The fix: make success the thing you observe
Instead of watching for failure, require proof of success. The job calls a URL when it finishes; if the call doesn't arrive within the window you expect, something is wrong. This is sometimes called a dead man's switch.
0 3 * * * /usr/local/bin/pg_dump_all.sh && curl -fsS -m 10 --retry 3 https://api.usedeadline.com/p/<token>
The && matters: the ping only fires if the command exited 0. -fsS keeps curl quiet on success but still reports errors, and --retry 3 survives a brief network blip so you don't get a false alarm.
Report failures explicitly
If the script can detect its own failure, say so immediately rather than waiting for the window to expire:
pg_dump_all.sh || curl -fsS -d "pg_dump exited $?" https://api.usedeadline.com/p/<token>/fail
Use the schedule you actually run
For a cron job, enter the same five-field expression and its IANA time zone in Deadline. A job scheduled with 0 3 * * * stays due at 3:00 AM local time across daylight-saving changes. Grace is the time after 3:00 that the job may legitimately need to finish.
If duration matters, wrap the command instead of sending only a completion ping:
dl run nightly-pg-dump -- /usr/local/bin/pg_dump_all.sh
Deadline records start, finish, duration, and a non-zero exit. Set “Finish within” to alert on a process that started but never returned.
What to monitor first
If you only instrument three jobs, make them these: the database backup, whatever writes to billing, and the certificate renewal. They share a property — the failure is invisible until the moment it is catastrophic.