Cron job monitoring: know when a job did not run

Cron does not tell you when a job silently stops. A heartbeat does: the job pings a URL when it finishes, and you get an alert if the ping does not arrive on time.

Why cron jobs fail quietly

Checking a website from outside cannot catch any of these. You need the job to report in.

How heartbeat monitoring works

  1. You create a heartbeat with a period (how often the job runs) and a grace time (how late is still fine).
  2. You add one line to the end of the job that requests the heartbeat URL, only when the job succeeded.
  3. If period plus grace passes with no ping, the heartbeat is marked late and you get one alert. The next ping closes it and sends one recovery alert.

Pick the grace time from how long the job usually takes plus some slack. A nightly backup that takes 20 minutes might use a 1 day period with 1 hour grace.

Heartbeat quick start

  1. Create a free Pingmoss account (no email needed) and add a cron heartbeat. Copy its ping URL.
  2. Append the ping to your job, using && so it only runs on success:
5 3 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 https://pingmoss.pages.dev/hb/YOUR_TOKEN > /dev/null
  1. Add an alert channel (webhook, Discord, Slack or Telegram) and send a test alert.

Examples for GitHub Actions, systemd, Python and Node are in the heartbeat docs. The Free plan includes 5 monitors, and heartbeats can use any period from 1 minute to 31 days. Pingmoss does not send email alerts yet and has no start or fail signals, so it covers the "did it run and succeed" question only. Comparing tools? See Pingmoss vs UptimeRobot, Healthchecks.io and Uptime Kuma.

Try it on the Free plan

5 monitors, 5 minute checks, 1 status page, chat and webhook alerts. No email address or card needed: you get a secret account key.

Create a free account Read the docs