On this page
  1. What is the simplest way to monitor a cron job?
  2. How do I choose alert settings?
  3. What else should I monitor about a job?
  4. Where AI coding assistants get this wrong
  5. Checklist
  6. FAQ
    1. What’s the difference between a heartbeat check and an uptime monitor?
    2. Can I monitor cron jobs without a third-party service?
  7. Related topics
  8. Sources
tutorial

How to Monitor Your Cron Jobs

Stop losing jobs to silent failures: add a heartbeat check to every cron job so you get alerted the moment it misses a run.

Quick answer

  • A heartbeat monitor pings a URL every time a job runs; if the ping stops, you get an alert.
  • Add one line to your cron job — curl the check URL — and failures become visible.
  • Free tiers of healthchecks.io or cron-job.org cover a small project completely.

What is the simplest way to monitor a cron job?

Sign up for healthchecks.io (free for 20 checks), create a check, and add its unique URL to the end of your cron command. Every run pings the URL; the service alerts you if no ping arrives within the schedule you set. Your job gains a visible heartbeat with one line of change, and you can require a success signal by making the ping conditional on the job exiting cleanly.

# Alert if the backup job misses its 2:30 a.m. run by more than 15 minutes
30 2 * * * /home/me/backup.sh && curl -fsS -m 10 --retry 5 -o /dev/null https://hc-ping.com/REPLACE_WITH_UUID

# Ping only on success; failures trigger the alert because no ping is sent
30 2 * * * /home/me/backup.sh && curl -fsS -m 10 --retry 5 -o /dev/null https://hc-ping.com/REPLACE_WITH_UUID

How do I choose alert settings?

Set the check period to your schedule (for a daily job, 24 hours) and the grace to roughly the longest the job could legitimately run plus a buffer. Choose where alerts go: email for free, or Slack/Telegram/phone push if the free plan offers it. The point is that a missed run should reach you as a notification, not a surprise discovered days later.

What else should I monitor about a job?

A heartbeat proves the job started, not that it succeeded. Two additions close the gap: ping the success URL only when the job exits zero, and have the job write a status line to a log you can inspect. For high-stakes jobs like backups, also verify the output — a backup that pings successfully while writing an empty file is still a failure.

Where this bites vibecoders

The classic AI-era incident is a ‘working’ cron job that has been failing for three weeks. Because the assistant set it up and the dashboard shows nothing, nobody knows. Heartbeat monitoring is a ten-minute habit that converts silent failures into phone notifications, and it’s exactly the kind of operational detail an AI assistant won’t volunteer — you have to ask for it or know to add it.

Where AI coding assistants get this wrong

  • Suggesting bare cron with no monitoring because the assistant has no concept of operational alerting.
  • Putting the heartbeat ping after the command with &&, so failures also ping and the monitor is useless.
  • Choosing a grace period shorter than the job’s real runtime, causing false alerts.
  • Monitoring the job but not the data it produces, so corrupt output goes unnoticed.

Checklist

  • Add a heartbeat check to every scheduled job that matters.
  • Ping the success URL only on clean exit (use &&).
  • Set period and grace to match the real schedule, with buffer for slow runs.
  • Configure alerts to reach you on a channel you actually check.

FAQ

What’s the difference between a heartbeat check and an uptime monitor?

An uptime monitor pings an endpoint from outside to check availability. A heartbeat check is the reverse: your job pings the monitor. Heartbeats are for scheduled jobs that run briefly; uptime monitors are for services that should be reachable 24/7.

Can I monitor cron jobs without a third-party service?

Yes: log output to a file and set up a separate alert when the log stops updating, or run a wrapper script that emails you on failure. A service like healthchecks.io is simpler and harder to get wrong, which is why it’s the recommended path.

Sources

Share: