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:

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:

#!/bin/bash set -euo pipefail # pipefail: a broken pipe now fails the job ./export.sh # writes /data/out.csv # Sanity-check the output before declaring success rows=$(wc -l < /data/out.csv) if [ "$rows" -lt 100 ]; then echo "export too small: $rows rows" >&2 curl -fsS https://cronping.cronping-oren.workers.dev/ping/<id>/fail # page me now exit 1 fi curl -fsS https://cronping.cronping-oren.workers.dev/ping/<your-check-id> # only reached on a real result

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.

Try it now

Get a ping URL in about ten seconds — no account, no email needed. Add an email later for alerts.

← All guides