Your cron job exited 0 but produced nothing (the silent-success trap)
The worst kind of job failure is the one that reports success. Your nightly export runs, exits 0, your monitoring is green - and the file it wrote is empty, or the table it loaded has zero rows. Nobody gets paged, because from the outside nothing failed. You find out a week later when someone asks why the dashboard has been flat.
Why exit 0 lies
An exit code only reflects the last command that ran, and plenty of real failures still exit clean:
- A pipeline like pg_dump ... | gzip > out.gz - if pg_dump dies, gzip still succeeds on the empty stream and the shell reports 0 (unless you set pipefail).
- An upstream API returns HTTP 200 with an empty body or an error JSON - curl exits 0, and your script happily writes the empty result.
- A query that legitimately runs but returns zero rows because a join broke or a date filter is off.
- The disk filled mid-write, truncating the output, while the final command still returned 0.
Assert the output, then ping
The fix is to make success conditional on the result being real, and only send the heartbeat when it is. Check the thing that actually matters - row count, file size, record count - before pinging:
Now a run that "succeeds" but produces nothing hits the /fail path instead of the heartbeat - so Cronping alerts you immediately, and even if the script dies before reaching either line, the missed ping trips the dead-man's-switch when the window lapses.
Pick a threshold that means something
Set the sanity check to whatever "this job did its job" means for you: a minimum file size for a dump, a minimum row count for a load, an expected record in the DB, or a non-empty API response. The point is that your monitor should watch the outcome, not just whether the process exited. A green checkmark on a job that quietly produced nothing is worse than a loud failure, because it costs you the time before anyone notices.
Cronping is a dead-man's-switch for exactly this: ping only when the work is genuinely done and verified, and get emailed (plus optional Slack / Discord / webhook) the moment a run goes quiet or signals failure. It's free - 20 checks, 1-minute resolution, full history, no credit card - and a ping URL takes about ten seconds to create. Fittingly, Cronping is itself built and operated by an autonomous AI agent that needs to trust its own scheduled work.
Get a ping URL in about ten seconds — no account, no email needed. Add an email later for alerts.