Cron jobs silent-fail — the most common cause of data loss. Default cron: on error, email (if SMTP set up), otherwise nothing. Right approach: heartbeat monitoring (dead-man's switch) — cron pings a URL on success, monitoring service waits for a ping and alerts if missed. Solutions: Enterno Heartbeat, Healthchecks.io, Cronitor.
Below: step-by-step, working examples, common pitfalls, FAQ.
5 2 * * * /usr/bin/backup.sh && curl -fsS PING_URLcurl -fsS PING_URL/fail on the error path| Scenario | Config |
|---|---|
| Simple success ping | 0 3 * * * /usr/local/bin/backup.sh && curl -fsS https://heartbeat.enterno.io/ping/abc123 > /dev/null |
| Ping with duration | 0 3 * * * curl -fsS -m 10 https://heartbeat.enterno.io/start/abc123 &&
/usr/local/bin/backup.sh &&
curl -fsS https://heartbeat.enterno.io/ping/abc123 |
| Fail ping on error | 0 3 * * * /backup.sh || curl -fsS https://heartbeat.enterno.io/fail/abc123 |
| With exit code | 0 3 * * * (/backup.sh; STATUS=$?; curl -fsS https://heartbeat.enterno.io/ping/abc123/$STATUS) |
| Systemd timer alternative | # /etc/systemd/system/backup.service
[Service]
ExecStart=/backup.sh
ExecStartPost=curl -fsS https://heartbeat.enterno.io/ping/abc123 |
A heartbeat monitor is a "reverse monitor": instead of us polling the service, the service signals us that it's alive. If no signal arrives within the set interval — we send an alert.
One GET request to a unique URL — and the monitor knows the job completed.
Set an acceptable ping delay to avoid false alerts.
Email and Telegram on missed ping. Repeated alert if silence continues.
Full ping log with timestamps — see every job execution.
cron job monitoring
background worker check
dead man's switch
payment queue monitoring
curl -s https://enterno.io/api/heartbeat/TOKEN — simple and reliable.Heartbeat monitor: 5 tasks free, Telegram and email alerts on missed runs.
Sign up freeOften SMTP isn't configured on a VPS → email never lands. Heartbeat actively alerts when cron didn't start at all (host down, cron daemon stopped).
Healthchecks — open-source + SaaS free tier. Enterno — integrated with uptime/SSL/DNS monitoring in one dashboard, + RU servers.
Same principle: <code>curl PING_URL</code> in postStart/postStop container lifecycle hook. Or a sidecar container.
Outbound HTTP is usually allowed. If not — self-hosted Healthchecks on internal network.