---
title: "Monitor cron jobs: setup in five steps"
url: "https://cronmissed.com/learn/monitor-cron-jobs.md"
canonical_url: "https://cronmissed.com/learn/monitor-cron-jobs"
last_updated: "2026-11-05"
type: "conceptual"
summary: "How to monitor cron jobs: add one curl to the job, create a check that expects it, pick an alert channel, and test it by letting one run fail."
related: ["https://cronmissed.com/learn.md", "https://cronmissed.com/learn/cron-job-monitoring-service.md", "https://cronmissed.com/learn/cron-monitoring.md", "https://cronmissed.com/docs/getting-started.md", "https://cronmissed.com/snippets/shell.md", "https://cronmissed.com/learn/cron-job-not-running.md"]
---

# Monitor cron jobs: setup in five steps

> **For AI agents:** the complete index of CronMissed pages is [llms.txt](https://cronmissed.com/llms.txt). Every page is also served as markdown at its URL plus .md.

How to monitor cron jobs: add one curl to the job, create a check that expects it, pick an alert channel, and test it by letting one run fail.

To monitor cron jobs, make each job send a ping when it finishes and tell a monitor how often to expect it. The monitor alerts you when a ping is late or reports a failure. The five steps below take one job from unwatched to tested.

## What do you need to monitor a cron job?

Three things: a check that knows the job's schedule, a line that tells the check the job ran, and a channel that carries the alert to you. Nothing else is required. Start with the job that would hurt most if it stopped, usually the backup.

## Where does the ping go in the job?

At the very end, and only if the job worked. In a crontab line that means `&&` after the command. To report the exit status instead, so a failure alerts at once, use `;` and put `$?` on the end of the URL:

```crontab
# Success only: no ping, no success
0 4 * * * /opt/etl/load-feed && curl -fsS --max-time 10 --retry 5 -o /dev/null https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10

# Exit status: any non-zero status marks the check down right away
0 4 * * * /opt/etl/load-feed; curl -fsS --max-time 10 --retry 5 -o /dev/null https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10/$?
```

For a job that runs longer than a minute, send a start ping as well. CronMissed then times the run and notices one that begins and never ends:

```
#!/bin/sh
PING_URL="https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10"
curl -fsS --max-time 10 --retry 5 -o /dev/null "$PING_URL/start" || true
/opt/etl/load-feed
status=$?
curl -fsS --max-time 10 --retry 5 -o /dev/null "$PING_URL/$status" || true
exit "$status"
```

## What does the alert look like?

You choose where it goes: email, Slack, Discord, Telegram, ntfy or a signed webhook. Press Send test on a channel before you rely on it, and assign it to the check. After that you get one message when the job goes down and one when it recovers, with the exit status and the end of the output if the job sent them.

## How do you set up the check?

1. Create a check and name it after the job.
2. Choose the schedule: a period such as every 24 hours, or the same cron expression the crontab uses, with a time zone.
3. Set the grace time. Use the larger of 5 minutes and one and a half times the usual run time, never more than half the interval.
4. Paste the ping URL into the job as shown above.
5. Run the job once by hand, then break it once on purpose and wait for the alert.

The [snippet builder](https://cronmissed.com/tools/snippet-builder.md) writes the check settings and the ping line for a schedule you give it.

## Which mistakes silence a monitor?

- **Pinging before the work.** A ping at the top of the script reports a job that had not started its work yet.
- **Using a semicolon with the plain URL.** The job fails and the ping still says success. Use `&&`, or the `$?` form.
- **A missing variable.** Cron does not read your shell profile, so a ping URL kept in one is empty. Set it in the crontab or the unit. See [cron environment and PATH](https://cronmissed.com/learn/cron-environment-and-path.md).
- **Plain HTTP.** An `http://` request is answered with a redirect to HTTPS, and curl without `-L` does not follow it, so the ping is lost.
- **A grace time that is too short.** Every slow night becomes a false alarm, and soon nobody reads the alerts.

## Questions

### How long does it take?

A few minutes for one job: a check, one line in the job, a channel and a test.

### What if the ping itself fails?

Use a timeout and ignore the result, as the examples do, so a lost ping can never fail the job. The check then goes late and down, which is the signal you want.

## Related pages

- [Cron job monitoring service](https://cronmissed.com/learn/cron-job-monitoring-service.md)
- [Cron monitoring](https://cronmissed.com/learn/cron-monitoring.md)
- [Getting started](https://cronmissed.com/docs/getting-started.md)
- [Shell and curl](https://cronmissed.com/snippets/shell.md)
- [Cron job not running checklist](https://cronmissed.com/learn/cron-job-not-running.md)

## Related

- [Cron monitoring explained: concepts and fixes](https://cronmissed.com/learn.md)
- [Cron job monitoring service: ping in, alert out](https://cronmissed.com/learn/cron-job-monitoring-service.md)
- [Cron monitoring for every server and pipeline](https://cronmissed.com/learn/cron-monitoring.md)
- [Getting started with CronMissed](https://cronmissed.com/docs/getting-started.md)
- [Ping CronMissed from a shell script with curl](https://cronmissed.com/snippets/shell.md)
- [Cron job not running: a checklist by system](https://cronmissed.com/learn/cron-job-not-running.md)
