Guides 6 min read
How to Monitor Cron Jobs with Heartbeats
Cron jobs fail silently. A heartbeat monitor alerts you when a scheduled job does not check in on time. How heartbeats work, how to add one to a crontab and which settings to choose.
ReadGlossary · Types of monitoring
Cron job monitoring
Heartbeat monitoring, also called cron job monitoring, watches scheduled jobs and background processes by expecting a signal, a ping to a URL, each time they run, and alerts when a ping doesn’t arrive on time.
Ordinary uptime checks ask a service from the outside. That doesn’t work for a backup script, a nightly import or a queue worker: they have no address to check, and when they stop, nothing visibly breaks until someone needs the data. A heartbeat turns the question around: the job reports in, and silence is the alert.
The job calls its own URL when it finishes, often with curl at the end of the crontab line. The monitor knows the schedule and allows a grace period for jobs whose run time varies. Pings at the start and on failure also catch jobs that hang, run too long, or run but fail.
0 3 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 https://YOUR-PING-URL
Runs every day at 03:00 and pings only when the backup succeeds (&&). If no ping has arrived by 03:00 plus the grace period, the job counts as down.
Uptimecheck cron job monitors give each job a ping URL and expect it from every minute to every week, or on a crontab schedule in your time zone, with a grace period from 1 minute to 6 hours. Ping /start to measure the run time and get an alert when a run takes too long, call /fail or send the exit code to report a failure at once, and POST the job’s output to see it with the failure.
14-day free trial · No credit card required
Guides 6 min read
Cron jobs fail silently. A heartbeat monitor alerts you when a scheduled job does not check in on time. How heartbeats work, how to add one to a crontab and which settings to choose.
ReadGuides 3 min read
Backups, imports and cleanups run on cron, and they fail silently. Common causes of missed cron jobs, how to troubleshoot them and how to get alerted when a job does not run.
ReadGuides 8 min read
A cron expression is five fields that say when a job runs. The syntax, special characters and @daily shortcuts, ready-to-use examples and the time zone and PATH mistakes that break jobs.
ReadExtra time after the expected run before a missing ping counts as a failure. Set it a little longer than the usual variation in the job’s start and run time.
At the end, after success, so a job that fails or hangs doesn’t ping. A start ping as well lets the monitor measure the run time and catch jobs that never finish.
Yes: anything that runs on a rhythm, such as queue workers, backups, data syncs, scheduled tasks on Windows and CI jobs, can ping a URL when it completes.
Set up your first monitor in under a minute, or look around the live demo first.
14-day free trial · No credit card required
With your OK, Google Analytics and Microsoft Clarity show us which pages help and where visitors get stuck. They set cookies for up to 13 months. Without your OK, neither of them runs. You can change your mind at any time under Cookie settings at the bottom of the page. Privacy policy