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:
- The monitor gives each job a unique URL.
- The job requests that URL when it finishes successfully.
- 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:
| Job | Period | Typical run time | Reasonable grace |
|---|---|---|---|
| Hourly product sync | 60 min | 2 min | 10 to 15 min |
| Nightly backup | 24 h | 25 min | 1 to 2 h |
| Weekly report | 7 days | 5 min | 3 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/abc123The && 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.phpand 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
- One heartbeat per job, named for what it does and for which client.
- Alert to a person. A heartbeat alert that goes to nobody is a log.
- Test it by running the job once and by deliberately skipping a signal to see the alert arrive.
- Document the owner and the restore path in the client file.
- Review monthly. Add jobs that were added to the site, remove those that were retired.
- 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.
- WordPress Plugin Handbook, Cron (developer.wordpress.org)
- Oh Dear, pricing and features (scheduled-task checks) (ohdear.app)
- Better Stack, pricing (monitors and heartbeats) (betterstack.com)