Home › Cron job monitoring
Guide · Cron monitoring

How to monitor cron jobs properly

Most cron monitoring watches the wrong half of the problem. It confirms that a scheduled call went out, but not that the nightly backup, the export or the queue drain actually ran. This guide covers both failure directions, how heartbeats and grace periods work, and how to wire alerts so a silent failure becomes a page instead of a surprise.

EU-hosted in Helsinki · GDPR-native · free during the private beta

The two ways a cron job fails

There are two common failure directions this setup covers, and they need different tools. The first is a scheduled call that fails: you asked a service to hit an endpoint on a timer, and the request errored or timed out. That one is easy to see, because something actively went wrong. The second is the dangerous one — a job you run yourself that silently never runs. The box was down, the crontab was edited, an earlier step exited non-zero, and the work simply did not happen. Nothing throws. You find out days later when the backups you needed are not there.

Good cron monitoring covers both. You want to know when a call fails, and you want to know when an expected run does not arrive at all.

Heartbeats and grace periods

The fix for silent failure is a heartbeat, also called a dead-man switch. You add one line at the end of your job that pings a URL only when the job finishes successfully. The monitor knows your schedule and expects that ping; if it does not arrive within a grace period, the check goes down.

# cron entry: run the job, then ping on success
0 3 * * *  /usr/local/bin/backup.sh && curl -fsS -m 10 "$MOJAQ_HEARTBEAT_URL"

# or ping from inside the script after the real work succeeds
# (copy the exact heartbeat URL for each job from your dashboard)

The grace period is what keeps this quiet in normal operation. A job that runs hourly but sometimes takes a few extra minutes should not page anyone; a job that has genuinely stopped should. You set the expected interval and how late is too late, and the monitor does the rest — including recording each run's status and duration so you can spot a job that is slowly getting slower.

Alert paths that reach a human

A missed heartbeat is only useful if the right person hears about it. Route alerts to Slack, Discord, a webhook or email per job, so the backup failure pages the on-call engineer and the marketing export nudges the marketing owner. Because MOJAQ keeps cron monitoring in the same account as your uptime checks, errors and deploys, a failed job lines up with the deploy or outage that caused it instead of arriving as an isolated mystery.

Get started

Create a free account and add a heartbeat for each job you run yourself: set the expected interval and grace period, copy the ping URL, and add one line to the end of the job. For jobs you would rather MOJAQ triggered, add a scheduled call with a name, URL and interval. Wire your alert channels, and you have both directions of cron covered. For brand-specific comparisons, see our cron-job.org alternative and Cronitor alternative pages.

Questions

What are the two ways a cron job fails?

Either a scheduled HTTP call you fire fails or times out, or a job you run yourself silently never runs at all — the machine was down, the schedule was wrong, or an earlier step crashed. The first is easy to see because something actively errors; the second is the one that bites, because nothing errors — the work just does not happen.

What is a grace period?

It is how late a job may be before you get alerted. If a job runs hourly but occasionally takes a few extra minutes, a short grace period stops false alarms while still catching a job that has genuinely stopped.

How does a heartbeat work?

You add one line at the end of your job that pings a URL when it finishes successfully. MOJAQ expects that ping on your schedule; if it does not arrive within the grace period, the check goes down and you are alerted.

Can MOJAQ also run the schedule for me?

Yes. MOJAQ can call your URL on an interval as a scheduled call, and it can watch the jobs you run yourself via heartbeats. Most teams use both, so they catch a failed call and a job that never ran.

Catch the cron job that silently never ran

Heartbeats with grace periods, scheduled calls, and alerts beside your uptime and errors — EU-hosted. Free while we are in beta.

Request beta access →