Heartbeat monitoring for scheduled jobs

Cron job monitoring that notices when a job never ran

A crashed server sends no error email. Add one curl after your job succeeds, and MonitorAH alerts you when that ping fails to arrive inside the window you set.

Each heartbeat monitor gets its own URL. Your job calls it when it finishes.
Each heartbeat monitor gets its own URL. Your job calls it when it finishes.

Why doesn't cron tell you when a job is missing?

Cron mails a job's output to MAILTO or the crontab owner, according to the crontab manual. That only helps when the job runs, produces output and mail works. If the host is down, the daemon stopped or the crontab entry disappeared, nothing runs, so nothing is sent and you hear nothing.

Hosted schedulers have their own gaps. GitHub's documentation says queued scheduled jobs may be dropped under high load, and scheduled workflows in public repos are disabled after 60 days without repository activity. A heartbeat checks from outside the scheduler, so all of these failures look the same: the expected ping does not arrive.

What does a heartbeat monitor give you?

  • One URL per job: Each monitor gets its own token, so a failed backup cannot hide behind a healthy sync job.
  • Grace window per job: Set anything from 30 seconds to 7 days. For a nightly job, 25 hours allows for normal run-time drift.
  • No client to install: Anything that can send an HTTP request can report in, including curl, a CI step or application code.
  • Pending until first ping: A new monitor gets one full grace window to receive its first ping before it can alert.
  • Escalation for missed jobs: Route a missed backup to an on-call rotation, repeat the alert and escalate if nobody acknowledges it.
  • Recovery on the next ping: The next successful ping closes the incident, so you know the job is healthy again.

How do you monitor a cron job with a heartbeat?

  1. Create a heartbeat monitor and copy its unique URL.
  2. Set the grace window longer than the job's schedule. A nightly job needs more than 24 hours, so use 25 hours.
  3. Put the curl call after the work, as in the script below. With set -e, a failed backup exits before the ping.
  4. Connect an alert channel, run the script once and confirm the monitor shows as up.
#!/bin/sh
set -e
/usr/local/bin/nightly-backup.sh
curl -fsS --retry 3 -X POST https://monitorah.com/api/v1/heartbeat/YOUR_TOKEN

A good fit if

  • You run backups, imports, billing runs or cleanup jobs on a schedule
  • Your jobs run more often than once a week
  • You want job alerts in the same place as uptime alerts
  • You need on-call escalation when a scheduled job fails

Look elsewhere if

  • Your job runs weekly or less often. The 7-day maximum grace window leaves no margin for a weekly job and cannot cover a monthly one.
  • You only need job monitoring at high volume. As of November 2026, Healthchecks.io Business Plus covers 1000 jobs for $80 per month.
  • You want run logs, durations or exit codes. A heartbeat records only that a ping arrived, so choose a job monitoring tool that captures run details.

Pricing

Heartbeats count as monitors, so the Free plan covers 10 scheduled jobs. Starter at $7 per month adds signed webhooks, SMS and voice for alerts on missed jobs. Pro at $19 adds PagerDuty, Opsgenie and Microsoft Teams.

Frequently asked questions

What grace window should I set for a cron job?

Use the job's schedule plus its longest normal run time and a small margin. The window is measured from the last ping, so a job that runs hourly and takes up to 10 minutes needs about 75 minutes. A nightly job fits 25 hours. If the window is shorter than the schedule, you'll get false alerts between runs.

Should the heartbeat go before or after the job?

After it. A ping at the start proves only that the job launched, while a ping at the end proves it finished. With set -e, a failing command stops the script before curl runs. Watch pipelines, though: in pg_dump app | gzip > app.gz, the shell sees the exit status of gzip, so a failed dump can look successful. In bash, add set -o pipefail.

Can a heartbeat detect a backup that is empty or corrupt?

Not by itself. A heartbeat proves your script reached the curl line. If the backup tool exits with status 0 after writing an empty file, the ping still goes out. Add a check before the ping, such as test -s backup.sql.gz, so an empty file stops the script. Test restores remain a separate job.

Is the heartbeat URL a secret?

Treat it like one. The token in the URL is the only authentication, so anyone who has it can send pings and keep that monitor showing as up. Keep it out of public repositories and CI logs. In GitHub Actions, store it as an encrypted secret. The token cannot read or change anything else in your account.

How does MonitorAH compare with Healthchecks.io for cron monitoring?

Healthchecks.io is a focused job monitor with 20 free jobs, and Business Plus covers 1000 jobs for $80 per month as of November 2026. MonitorAH has fewer free monitors, 10, but puts heartbeats beside HTTP checks, status pages and on-call. Choose Healthchecks.io for jobs alone. The heartbeat tutorial walks through a full setup.

Related guides

Add a heartbeat to your most important job

Start with the job you would least want to fail unnoticed. It takes one line at the end of the script.

Start monitoring free