Cron monitoring

Cron job monitoring: get alerted when a job fails or never runs

Healthchecks.io watches 20 cron jobs free and Cronitor 5. PushPiper puts their missed-run alerts on your phone, free. Each job pings the service when it finishes, and a late or failed ping triggers the alert; PushPiper covers 10,000 messages a month on 10 devices.

Why a cron job cannot report its own failure

When a cron job breaks completely, it stays silent. If a server loses power, a disk fills up, or the cron daemon dies unexpectedly, the script never executes in the first place, which means any error handling inside your script never runs either. How could a dead process tell you it died? Silent failures are dangerous.

That silence is why dead man's switch monitoring exists. The core heartbeat idea is simple: your script pings an external URL whenever it finishes work. If that ping does not arrive within the expected window, the monitoring service assumes the job failed and sends an alert. So instead of waiting for a broken job to speak up, you rely on an outside listener that yells when the ping goes missing.

If you only need a quick status ping when a task completes, you can send push notifications from shell scripts and cron jobs straight to an API. But for nightly backups, an external heartbeat is the only safe way to verify that the job actually ran.

Comparing free heartbeat monitoring services

You don't need to build your own heartbeat receiver when established tools offer solid free tiers. Free plans vary widely.

  • Healthchecks.io: The Hobbyist plan gives you 20 checks for free with 100 log entries per check and no limit on team size. It includes webhook integrations on free accounts, and the Business plan costs $20 a month for 100 checks.
  • Cronitor: The free plan includes 5 monitors, email and Slack alerts, and a 5-minute fastest check interval, though it lacks SMS alerts. Business plans start at $2 per monitor plus $5 per user.
  • Dead Man's Snitch: The free plan gives you 1 snitch for hourly, daily, weekly, or monthly jobs, sending notices only via email.

Here is how the main heartbeat services compare on their free tiers and where PushPiper fits for alert delivery.

ServiceFree planPaid fromAlerts on free
Healthchecks.io20 checks$20 a month for 100 checksEmail, webhooks and more
Cronitor5 monitors$2 per monitor plus $5 per userEmail and Slack
Dead Man's Snitch1 snitchNot listed hereEmail
PushPiperDelivery only, 10,000 messages a monthEUR 4 a month for 50,000Push to phone and desktop

If you have more than a handful of cron jobs to track, Healthchecks.io is the obvious pick because it includes 20 free checks along with native webhook support that works without paying for an upgraded subscription. Dead Man's Snitch works fine for a single script, but that single monitor limit runs out fast.

Setting up the cron line for success and failure pings

Heartbeat services generate a distinct URL for each task you monitor. On Healthchecks.io, that address looks like https://hc-ping.com/YOUR-UUID.

When your job finishes cleanly, it pings the base URL. If your command fails, it pings the same address with /fail at the end, which tells the monitoring service about the failure right away instead of waiting for a missed deadline. Check your path carefully.

Here is the standard cron line that handles both success and failure:

crontab
0 3 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 5 -o /dev/null https://hc-ping.com/YOUR-UUID || curl -fsS -m 10 --retry 5 -o /dev/null https://hc-ping.com/YOUR-UUID/fail

To use this line on your own server, change these two values:

  1. Replace /usr/local/bin/backup.sh with the full path to your script or command.
  2. Replace YOUR-UUID in both URLs with the unique identifier from your check dashboard.

The && operator ensures the success curl only fires if the backup script exits with zero. If the script fails, the || operator runs the second curl instead, notifying the service immediately. The flags -fsS -m 10 --retry 5 keep curl quiet on success, set a 10-second timeout so a network freeze won't stall your server, and retry up to five times before giving up on a transient connection error.

Routing heartbeat alerts to your phone with PushPiper

Once your monitor tracks your tasks, you need failure alerts to reach your phone immediately. Piping notices to Slack or email inboxes often means you discover a failed backup hours late.

You can forward those alerts directly to your phone or computer with PushPiper. After you sign up for PushPiper with a Google account, you install the app through your browser via Web Push. On Android, Windows, macOS, and Linux, you can use Chrome, Edge, Firefox, or Safari. On an iPhone or iPad running iOS or iPadOS 16.4 or later, open pushpiper.com/app in Safari, tap Share, and tap Add to Home Screen to install the web app directly without buying anything through an app store. PushPiper has no native App Store or Play Store apps yet, and it does not make phone calls or send SMS texts, but Web Push delivers notifications across your devices without app store purchases. It arrives instantly.

You can route alerts from your heartbeat provider using either webhooks or email:

Option 1: Webhooks

Healthchecks.io supports custom webhooks directly on its free Hobbyist plan. In Healthchecks.io, add a webhook integration pointing to https://api.pushpiper.com/1/messages.json. You can pass your app token, user key, and a custom message using variables like $NAME and $EXITSTATUS. For exact payload steps, check our guide on Healthchecks.io push notifications.

Option 2: Email gateway

If you use Cronitor Free or Dead Man's Snitch, which both support email alerts on their free plans, you can send those messages straight to PushPiper's email gateway.

  1. Open PushPiper, go to Settings, and select Email.
  2. Create a private address (such as a random string of 20 characters at pushpiper.app).
  3. Add that address as your notification recipient in your heartbeat monitor.

When an alert fires, PushPiper turns the subject line into the notification title and the message body into push text up to 1,024 characters. Review the PushPiper pricing page if you ever exceed the free 10,000 messages a month; Pro starts at EUR 4 a month for 50,000 messages.

Repeating emergency alerts for critical jobs

Some cron jobs, like billing runs or database backups, cannot wait until morning when they break. While PushPiper has no on-call rotations or escalation schedules, you can use priority 2 emergency alerts to repeat notifications until someone acknowledges them.

Emergency alerts require a retry duration of at least 30 seconds and an expire window of up to 10,800 seconds, repeating every retry cycle until someone acknowledges the notification in the app or the alert expires. Each alert repeats up to 50 times, and emergency repeats do not count extra against your 10,000 free monthly messages.

Sources

Questions and answers

What happens if the server loses power during a cron job?

Because the server lost power, the script will not finish and will never ping the heartbeat URL. Once the scheduled time window and grace period elapse on the monitoring service, it marks the check as missing and triggers an alert.

Can I monitor cron jobs that run every minute?

That depends on the service. On the free tiers with intervals listed here, Cronitor's fastest check is 5 minutes, and Dead Man's Snitch supports hourly, daily, weekly, or monthly intervals.

Does PushPiper wake me up if Do Not Disturb is active?

No, PushPiper notifications do not break through iOS Do Not Disturb or Focus modes. Emergency priority 2 alerts will repeat every retry interval until acknowledged, but your operating system controls whether the screen lights up or makes sound during Focus hours.

Why should I use curl with retry flags for heartbeats?

Network glitches can cause a single ping request to fail even when your script ran successfully. Adding curl retry flags ensures temporary connectivity drops do not generate false failure alerts.

Free for 10,000 messages a month

Sign in with Google and send your first ping in a minute.

Get started for free