Black Friday: 60% off yearly plans with code BF2026, until November 30. See the deal

Learn

Heartbeat monitoring: catch cron jobs that silently stop

Heartbeat monitoring flips the usual direction: your job sends a ping when it runs, and the monitor alerts you when the ping does not arrive on time. It catches backups, cron jobs and queue workers that fail silently, which a normal uptime check cannot see.

The short answer
  • The monitor stays silent while pings arrive, and alerts when one is late.
  • Uptime checks test a URL from outside. Heartbeats test a job from inside, which has no URL.
  • Add a start signal and a fail signal to catch jobs that hang or exit with an error.

Uptime check or heartbeat: which one catches what?

Pull checks vs push checks
FailureUptime (HTTP) checkHeartbeat check
Website returns 500YesNo
Nightly backup did not runNoYes
Cron daemon stoppedNoYes
Queue worker hungNoYes
Job ran but took far too longNoYes, with start and finish pings

How does a heartbeat check decide a job is late?

Terms follow the Healthchecks.io documentation. Other services use similar ideas under different names.

Simple period

Late once the period passes since the last ping. A 1-hour period with a ping at 12:00 is late at 13:00.

Cron schedule

Late at the scheduled time if no ping arrived. For 10 * * * * the check is late at 13:10 for the 13:00 hour.

Grace time

Extra wait before alerting. With a 5-minute grace, the 1-hour check alerts at 13:05.

Start, success and fail

Append /start when the job begins and /fail when it breaks. The plain URL means success.

What does a heartbeat look like in a crontab?

crontab: ping only when the job succeeds
# run the backup at 02:30; ping the monitor only if it exits 0
30 2 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 -o /dev/null https://hc-ping.com/YOUR-UUID

# with start and fail signals
30 2 * * * curl -fsS -m 10 -o /dev/null https://hc-ping.com/YOUR-UUID/start; /usr/local/bin/backup.sh && curl -fsS -m 10 -o /dev/null https://hc-ping.com/YOUR-UUID || curl -fsS -m 10 -o /dev/null https://hc-ping.com/YOUR-UUID/fail

How do you set one up correctly?

  • Set the period to the real schedule, then add grace time for normal run-time variation.
  • Treat the ping URL as a secret. Anyone with the UUID can send signals to your check.
  • Ping on success only, so a failing job produces silence or a /fail signal.
  • Use a short curl timeout so a monitoring outage cannot hang your job.
  • Test the alert once by skipping a ping on purpose.

WordPress note

WP-Cron only runs when someone loads a page, so scheduled posts and backups can be late on quiet sites. A heartbeat from a system cron job calling wp-cron.php shows when it stalls. See WordPress and ecommerce monitoring.

What jobs are worth a heartbeat?

Any job whose failure nobody would notice for days deserves one. These are the usual candidates.

  1. 01

    Backups

    A backup that quietly stops is found only when you need a restore. Ping after the backup and its verification step.

  2. 02

    Billing and invoice runs

    Missed runs cost money and cause support tickets days later.

  3. 03

    Queue workers and mail senders

    Workers can hang while the website keeps loading, so ping from inside the worker loop.

  4. 04

    Data imports and syncs

    Feeds from suppliers or analytics exports that other systems rely on.

  5. 05

    Certificate and domain renewal scripts

    Automated renewals fail silently when a record changes.

Common questions

What is heartbeat monitoring?

A check where your system pings the monitor at regular intervals to prove it is alive. If an expected ping does not arrive within the period plus grace time, the monitor sends an alert. It is also called dead man switch or cron monitoring.

How do you monitor a cron job?

Add a curl call to the monitor ping URL at the end of the job, chained with && so it only runs on success. Configure the check with the cron schedule and a grace time, then alert by email or chat when it is late.

What is grace time?

Extra time the monitor waits after the expected ping before alerting. It absorbs normal variation, such as a backup that sometimes takes 12 minutes instead of 8. It also caps the gap between a start and a success signal.

Can heartbeat monitoring detect a job that runs but fails?

Yes, if the job reports failure. Send a /fail signal on a nonzero exit, or send the success ping only after a good run so a failing job leads to a late ping alert.

Watch your domains automatically

Aepto monitors expiry, DNS, SSL and uptime for every domain you own and alerts you when something changes. Free for 3 domains.