Beamfar

Heartbeat and cron job monitoring: the basics

An uptime check asks a site “are you there?”. It cannot ask “did last night’s backup run?”, because the answer is not on any page. Scheduled jobs fail by not happening, and a thing that does not happen leaves no error to catch. Heartbeat monitoring turns that around.

What a heartbeat is

A heartbeat (also called a dead man’s switch, a check-in or a push monitor) works in the opposite direction from an uptime check:

  1. The monitor gives each job a unique URL.
  2. The job requests that URL when it finishes successfully.
  3. The monitor expects a request within a time window. If none arrives, it alerts.

The monitor does not need to reach the job’s server, so it works for jobs behind firewalls, on laptops in an office and on shared hosting. The silence is the signal.

What it is good for

  • Backups. The most common silent failure: the job stops, the logs rotate, and the first sign is a restore that fails.
  • Scheduled content. Newsletters, feed imports, product syncs, report emails.
  • Payment and order jobs. Reconciliation, subscription renewals, abandoned-cart emails.
  • Maintenance tasks. Cache clearing, log rotation, certificate renewal scripts (see SSL certificate expiry).
  • Anything the site depends on that nobody sees. Search index rebuilds, image processing queues.

Choose the period and the grace time

Two numbers define a heartbeat:

  • Period: how often the job should run (every 5 minutes, daily at 02:00, weekly).
  • Grace time: how late a signal may be before it counts as missing.

A rule that works: grace time is longer than the job’s normal run time plus its normal jitter, and shorter than the time it takes for a miss to hurt. Examples:

JobPeriodTypical run timeReasonable grace
Hourly product sync60 min2 min10 to 15 min
Nightly backup24 h25 min1 to 2 h
Weekly report7 days5 min3 to 6 h

Too tight and the monitor alerts on a slow night. Too loose and a miss is found after the damage is done.

What to send

The most useful pattern is to signal success only, at the end of the job:

backup.sh && curl -fsS --retry 3 https://monitor.example/ping/abc123

The && means the signal is sent only if the backup command succeeded. If the script fails, there is no signal and an alert follows. Some tools also accept an explicit failure signal (a different URL or a status) so you can alert at once instead of waiting for the grace time. Ask which you prefer: speed or fewer moving parts.

Add --retry so a brief network error does not look like a failed job, and keep the URL secret: anyone who has it can send a false signal.

WordPress: why wp-cron needs a heartbeat

WordPress schedules its jobs with WP-Cron. The WordPress handbook explains that WP-Cron checks the list of scheduled tasks on every page load and runs whatever is due; it does not run constantly as a system cron does, and it is triggered only by page loads. If a site receives no visits for hours, scheduled posts, backups and mail queues run late, and the handbook’s own example is a task due at 2 p.m. that runs when the first visitor arrives at 5 p.m.

Two consequences for an agency:

  • A low-traffic site may miss its schedules, and a cached site (where page loads rarely reach PHP) may run them rarely. A heartbeat on the job shows you the delay.
  • Many agencies disable the page-load trigger in wp-config.php and run the cron endpoint from the server’s real cron on a schedule. That works, and it needs a heartbeat, because now a broken crontab means nothing runs and nobody visits to notice.

Cron and systemd timers

A crontab line does not tell you whether it ran or whether it worked. Common failure causes: a changed path, a missing environment variable, a full disk, a password that expired, an error swallowed because the output goes to a mail account nobody reads. Add the heartbeat to the end of the command, not to the beginning, and send the job’s output to a log you can find.

Practical rules

  1. One heartbeat per job, named for what it does and for which client.
  2. Alert to a person. A heartbeat alert that goes to nobody is a log.
  3. Test it by running the job once and by deliberately skipping a signal to see the alert arrive.
  4. Document the owner and the restore path in the client file.
  5. Review monthly. Add jobs that were added to the site, remove those that were retired.
  6. Pair with a restore test. A backup heartbeat proves that the job ran, not that the backup can be restored. Restore one every quarter.

Where Beamfar fits, and where it does not

Beamfar checks sites from outside (the page, the certificate, DNS records, redirects, SEO-risk signals, domain expiry, TCP ports and DNS blocklists) and also has heartbeat (cron) monitors: a job calls a ping URL when it finishes, and a missed or late call raises an alert. These are built and have not run against real customer jobs yet. Other tools offer heartbeats too: Oh Dear lists scheduled-task (cron) checks on its pricing page, and Better Stack’s pricing page lists heartbeats next to its monitors (both read on 2026-10-20). Pick by the rest of what you need: Beamfar for what visitors and search engines see plus your jobs, a broader tool if you also need servers or on-call.

Questions

What is the difference between heartbeat monitoring and uptime monitoring?

An uptime check reaches out to your site and asks if it responds. A heartbeat waits for your job to report in, and alerts if the report does not arrive within the expected window.

How do I choose a grace time?

Make it longer than the job’s normal run time plus its usual variation, and shorter than the time a miss would take to cause harm. A nightly backup that takes 25 minutes might have a grace time of one to two hours.

Why do WordPress scheduled tasks run late?

WP-Cron is triggered by page loads, not by a clock. On a site with few visits, the WordPress handbook notes that tasks can run well after their scheduled time. A server cron job calling the cron endpoint on a schedule avoids this, and needs a heartbeat of its own.

Does a successful heartbeat prove the job worked?

It proves the job reached its last line and reported. Send the signal only after the work has succeeded, and test the result separately, for example by restoring a backup.

Sources

Read on . Standards and vendor pages change; confirm the current text before you rely on it.

Terms used in this guide

  • Heartbeat monitoringHeartbeat monitoring waits for a scheduled job to report in and alerts when the signal is missing. How the period and grace time work and what it is good for.
  • Cron jobA cron job is a task scheduled to run at set times on a server. Why it fails silently, how WP-Cron differs from system cron and how to monitor it.
  • Uptime monitoringUptime monitoring requests a website from outside at intervals and alerts when it fails to answer. What it measures, what it misses and how it is confirmed.
  • Check intervalThe check interval is the time between two uptime checks. How it sets the detection delay, the number of checks and how it interacts with confirmation.

Know first. Know why. Tell your client before they call.

Paste your client list. Both regions start checking.

No card for the trial.