---
title: "Start and finish pings for long-running jobs"
url: "https://cronmissed.com/learn/start-and-finish-pings.md"
canonical_url: "https://cronmissed.com/learn/start-and-finish-pings"
last_updated: "2026-10-22"
type: "conceptual"
summary: "Send /start when a job begins and a normal ping when it ends. CronMissed then times each run and alerts if a started run never finishes."
related: ["https://cronmissed.com/learn.md", "https://cronmissed.com/docs/pinging-api.md", "https://cronmissed.com/learn/choosing-grace-time.md", "https://cronmissed.com/learn/exit-codes-and-failure-signals.md", "https://cronmissed.com/learn/overlapping-cron-runs.md"]
---

# Start and finish pings for long-running jobs

> **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.

Send /start when a job begins and a normal ping when it ends. CronMissed then times each run and alerts if a started run never finishes.

A single ping at the end only proves that a job finished. Add a ping at the start and CronMissed also knows when a run began, how long it took, and when it began and never ended. For any job that runs longer than a minute, send both.

## How do the two signals work together?

```
#!/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"
/usr/local/bin/long-job.sh
curl -fsS --max-time 10 --retry 5 -o /dev/null "$PING_URL/$?"
```

- /start marks the check as started.
- A success ping within the grace time ends the run and records its duration when the start and the finish are under 72 hours apart.
- A failure ping, or an exit status other than 0, goes down at once.
- If neither arrives within the grace after the start, the check goes down with the reason "start timeout".

## How are overlapping runs told apart?

Add a run ID to every ping of one run: `?rid=<uuid>`. A finish carrying the same ID as the latest start closes that run. Only the most recently started run is timed. Clients can choose IDs at random or derive them. CronMissed also treats an identical signal with the same ID, repeated within 10 minutes, as one event, so `curl --retry` cannot double-count.

```shell
rid=$(cat /proc/sys/kernel/random/uuid)
curl -fsS "https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10/start?rid=$rid"
run-the-job
curl -fsS "https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10?rid=$rid"
```

## Why is this better than a long grace time?

Without a start ping the check can only wait for the whole schedule plus grace before it can complain. With one, a job that hangs five minutes in is reported when its grace after the start is over, which is early and specific. [Choosing a grace time](https://cronmissed.com/learn/choosing-grace-time.md) explains how to set it.

## Questions

### Do I need to send the start ping for short jobs?

It is optional for jobs that finish in seconds. It costs one request and adds run times to the log, so many people add it everywhere.

### What if the start ping fails to send?

The job should still run. Use a timeout and ignore the result of the start ping, as the examples do. The check then behaves as it would without a start signal.

## Related pages

- [Pinging API](https://cronmissed.com/docs/pinging-api.md)
- [Choosing a grace time](https://cronmissed.com/learn/choosing-grace-time.md)
- [Exit codes and failure signals](https://cronmissed.com/learn/exit-codes-and-failure-signals.md)
- [Overlapping cron runs](https://cronmissed.com/learn/overlapping-cron-runs.md)

## Related

- [Cron monitoring explained: concepts and fixes](https://cronmissed.com/learn.md)
- [Pinging API reference](https://cronmissed.com/docs/pinging-api.md)
- [How to choose a grace time for a cron check](https://cronmissed.com/learn/choosing-grace-time.md)
- [Exit codes and failure signals in cron jobs](https://cronmissed.com/learn/exit-codes-and-failure-signals.md)
- [How to stop overlapping cron job runs](https://cronmissed.com/learn/overlapping-cron-runs.md)
