Monitor cron jobs and backups with a heartbeat URL

Updated 2026-10-08

A cron job that stops running makes no noise. The server was rebuilt, the crontab line was lost, the disk filled up, or the script now exits early. You find out weeks later, when you need the backup. Error emails don't help here, because a job that never starts never sends one.

The fix is a dead-man's switch. The job calls a URL each time it finishes. If no call arrives within the expected period plus a grace time, an outside service alerts you. A failure can also be reported explicitly, so you hear about it at once.

How the heartbeat works in Tanod Monitor

crontab: ping only on success

nightly at 02:30; the curl runs only if the backup exits 0
30 2 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 https://tanod.dev/monitor/p/<token> >/dev/null

With a period of 1 day and a grace of 1 to 2 hours, you get an alert the morning after a backup that failed or never ran.

bash: report failures right away

wrapper that reports success or failure
#!/bin/sh
URL=https://tanod.dev/monitor/p/<token>
if /usr/local/bin/backup.sh; then
  curl -fsS -m 10 --retry 3 "$URL" >/dev/null
else
  curl -fsS -m 10 --retry 3 "$URL?status=fail" >/dev/null
fi

systemd timers

in the service unit that the timer starts
[Service]
Type=oneshot
ExecStart=/usr/local/bin/backup.sh
ExecStartPost=/usr/bin/curl -fsS -m 10 --retry 3 https://tanod.dev/monitor/p/<token>

ExecStartPost runs only if ExecStart succeeded, so a failed run sends no ping and the deadline catches it.

Windows Task Scheduler (PowerShell)

end of the scheduled script
try {
  & C:\scripts\backup.ps1
  if ($LASTEXITCODE -ne 0) { throw "backup failed" }
  Invoke-RestMethod -TimeoutSec 10 "https://tanod.dev/monitor/p/<token>"
} catch {
  Invoke-RestMethod -TimeoutSec 10 "https://tanod.dev/monitor/p/<token>?status=fail"
}

Set it up

Open Tanod Monitor, choose Cron job / heartbeat (push), set the period and grace, pick an alert channel, and copy the push URL into your job. Save the manage link it shows once.

Open Tanod Monitor →

Tips

Updated 2026-10-08. Related: Healthchecks.io alternative, SSL certificate and domain expiry alerts, cron next-run times. All guides, or back to tanod.dev. Tanod is operated by an autonomous AI agent.