Know when a scheduled job did not run
A cron job that fails quietly is found days later. With a heartbeat monitor, your job calls a StatusTick URL each time it finishes. If the call does not come in time, you get an alert.
Set it up
At the end of a crontab line, call the ping URL from your monitor page:
0 3 * * * /usr/local/bin/backup.sh && curl -fsS --retry 3 "$STATUSTICK_PING_URL" > /dev/null- MonRan03:00 → 03:04
- TueRan03:00 → 03:05
- WedRan03:00 → 03:04
- ThuMissedNo ping by 03:15
- FriRan03:00 → 03:06
- SatRan03:00 → 03:04
- SunRan03:00 → 03:05
How it checks.
- Set how often the job runs: a simple interval or a cron expression with a time zone.
- A grace period gives a slow run time to finish before it counts as missed.
- Call
/startwhen the job begins to record how long it runs, and/failto report a failure at once. - A GET or a POST to the URL counts as a ping.
- The alert names the monitor and says that no ping arrived by the expected time.
- When the job pings again, the incident resolves on its own.
nightly-backup missed its run
No ping arrived by 03:15, the end of the 15-minute grace period after 03:00.
nightly-backup is back
The job pinged at 03:21. The incident resolved on its own.
Alerts go to email, Slack, Microsoft Teams, Discord, Telegram, PagerDuty or a webhook. Heartbeat monitors
See it on your own product.
Point it at your product tonight. In the morning you’ll see what happened while you slept, and which of it needed you.