---
title: "Monitor rsync jobs by exit value"
url: "https://cronmissed.com/guides/rsync.md"
canonical_url: "https://cronmissed.com/guides/rsync"
last_updated: "2026-10-22"
type: "how-to"
summary: "rsync exits 23 for a partial transfer and 24 when source files vanished. Send the exit value to CronMissed and choose which codes are failures."
related: ["https://cronmissed.com/guides.md", "https://cronmissed.com/guides/restic.md", "https://cronmissed.com/guides/borg.md", "https://cronmissed.com/guides/linux-crontab.md", "https://cronmissed.com/learn/exit-codes-and-failure-signals.md"]
---

# Monitor rsync jobs by exit value

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

rsync exits 23 for a partial transfer and 24 when source files vanished. Send the exit value to CronMissed and choose which codes are failures.

rsync has a long list of exit values, and two of them are easy to mistake for success: 23 for a partial transfer due to an error and 24 for files that vanished at the source. Pass the value to CronMissed and decide which ones should raise an alert.

## How can a scheduled job fail silently on rsync backups?

- Exit value 23 means a partial transfer due to an error: some files were copied and some were not.
- Exit value 24 means a partial transfer due to vanished source files. It is common on live directories, where a file is deleted during the run.
- Exit value 30 is a timeout in data send or receive and 35 a timeout waiting for the daemon connection; both are typical of a network that dropped mid-transfer.
- Exit value 25 means the --max-delete limit stopped the deletions, which is a deliberate safety stop that still leaves the destination out of date.
- Run through cron without a tty, rsync over SSH fails if the key needs a passphrase, and the failure is an exit value that nobody reads.

## What are the limits of rsync backups?

| Limit | What the documentation says |
| --- | --- |
| 0 | Success. |
| 23 | Partial transfer due to error. |
| 24 | Partial transfer due to vanished source files. |
| 25 | The --max-delete limit stopped deletions. |
| 30, 35 | Timeouts in data transfer or in waiting for the daemon connection. |

## How do you add a CronMissed ping to rsync backups?

The script reports the start, runs rsync, and maps exit value 24 to success because vanished files are usual on a live source. Every other non-zero value is sent as it is.

```
#!/bin/sh
PING_URL="https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10"
curl -fsS --max-time 10 --retry 5 --retry-connrefused -o /dev/null "$PING_URL/start"
output=$(rsync -a --delete --max-delete=1000 /srv/data/ backup@backup-host:/srv/backup/data/ 2>&1)
status=$?
if [ "$status" -eq 24 ]; then status=0; fi
printf '%s\n' "$output" | tail -c 100000 | curl -fsS --max-time 10 --retry 5 --retry-connrefused -o /dev/null --data-binary @- "$PING_URL/$status"
exit $status
```

## Which check settings fit rsync backups?

Create a cron check with the schedule of the job and a grace that fits the longest sync. Incremental runs are quick, but the first run after a long outage can take hours, so allow for that or add a start timeout. A --max-delete safety stop (25) is the useful failure to catch: it means something deleted far more than usual at the source.

## How do you confirm the check works?

1. Run the script by hand and confirm both pings.
2. Point the destination at an unreachable host and confirm the check goes down with a non-zero value.
3. Delete a file from the source in the middle of a test run and confirm that 24 is treated as success.

## Questions

### Why treat 24 as success?

Because the files that vanished are no longer there to copy, and the rest was transferred. If vanished files should be an alert in your case, remove the line that maps it.

### Can the ping include what rsync did?

Yes. The script sends the end of rsync's output as the ping body, up to 100 kB, so the ping log shows the last files and any error messages.

## Sources

- [rsync manual page](https://download.samba.org/pub/rsync/rsync.1), read 22 October 2026

## Related pages

- [restic backups](https://cronmissed.com/guides/restic.md)
- [BorgBackup](https://cronmissed.com/guides/borg.md)
- [Linux crontab](https://cronmissed.com/guides/linux-crontab.md)
- [Exit codes and failure signals](https://cronmissed.com/learn/exit-codes-and-failure-signals.md)

## Related

- [Monitor cron jobs on every platform: 24 guides](https://cronmissed.com/guides.md)
- [Monitor restic backups with exit codes](https://cronmissed.com/guides/restic.md)
- [Monitor BorgBackup runs with return codes](https://cronmissed.com/guides/borg.md)
- [Monitor Linux crontab jobs with curl](https://cronmissed.com/guides/linux-crontab.md)
- [Exit codes and failure signals in cron jobs](https://cronmissed.com/learn/exit-codes-and-failure-signals.md)
