Site Monitors

How to monitor cron jobs and backups with a heartbeat

Updated October 26, 2026 · 6 min read

A website that's down is obvious. A nightly backup that stopped running three weeks ago isn't, because nothing visible breaks. You find out the day you need the backup. Scheduled jobs fail quietly, and an ordinary uptime check can't see them, because there's nothing to request.

A heartbeat monitor turns this round. Instead of you checking the job, the job reports in each time it runs. If a report doesn't arrive on time, you're alerted.

How a heartbeat works

  1. You create a heartbeat and say how often the job should run and how late a report may be.
  2. You get a private web address, called the ping address.
  3. At the end of the job, you make a request to that address.
  4. If no request arrives by the time it's due plus the allowance, the heartbeat is marked down and you're alerted. When the next report arrives, it's marked up again and you're told.

Site Monitors offers heartbeat monitors from the Starter plan. Give it a name like "Nightly backup", choose how often it runs (from every 5 minutes to every 7 days) and how late a report may be (from 1 minute to 6 hours).

Add it to a cron job

Add one request at the end of the job, joined with && so it only runs if the job succeeded:

0 2 * * * /opt/scripts/backup.sh && curl -fsS -m 10 --retry 3 https://example.com/api/ping/YOUR-CODE > /dev/null

Replace the address with your heartbeat's own. What the options do:

In a shell script, put the request on the last line. For a systemd timer, use ExecStartPost= in the service, or add the request to the end of the script it runs. Any tool that can call a web address, such as a backup program's "notify URL" setting, works too.

Pick sensible numbers

Test it before you rely on it

  1. Make a heartbeat with the shortest schedule, every 5 minutes with 1 minute to spare.
  2. Run the curl command by hand and watch it show as on time.
  3. Stop sending reports. After about 6 minutes it goes overdue and you're alerted.
  4. Send one again, and check it returns to up. Then set the real schedule.

What to monitor this way

Keep the address private. Anyone who has it can send reports for that heartbeat, and if it leaks, delete the heartbeat and make a new one.

Get alerted before it expires

Create a free account and we'll watch your certificates and domains for you, and email you before anything expires. Free for up to 5 sites.