Cronjob.de › Guides › Backup
Monitoring backups: know before you need them
Your backup script runs at night via cron. Whether it ran last night, nobody tells you – until you want a file back. With a heartbeat the script reports every run and its result to Cronjob.de, and you get a message when the check-in is missing or the script returns an error.
Why at all
Why you would not notice otherwise
Cron starts the script and forgets about it. Its output ends up in a mail to root that nobody reads, or straight in /dev/null. If the server is down, no backup starts – and certainly no message arrives.
Then there are the silent cases: the target is full, the repository password has changed, a lock left by an aborted run blocks the next one. restic then exits with code 11 (repository locked) or 12 (wrong password), for example, and borg with 2. The script ran, the backup did not.
The line below passes on exactly this exit code. 0 means success, anything else reports a failure – right away, not only when the next check-in is missing.
- Ping address (example)
https://runcheck.de/a8k3m2x9q1- Schedule
- as in your crontab, usually daily
- Applies to
- rsync, restic, BorgBackup
- Sufficient Cronjob.de plan
- One heartbeat is free; you see its status in your account. Email alerts come with Plus (€17.88 a year), Slack, Teams and Discord with Unlimited.
Setup
Set up in three steps
What is a heartbeat?
A regular sign of life: after every run your job calls its own address at Cronjob.de. If the call is overdue or the job reports a failure, we alert you. More about heartbeats
-
Create a heartbeat
In your account, create a new one under “Heartbeats”: a name, how often the backup runs – usually daily – and how much leeway it gets, one hour for example. You receive a ping address of its own, such as
https://runcheck.de/a8k3m2x9q1. -
Append the check-in to the crontab line
Open the crontab with
crontab -eand extend your backup line.$?is the script's exit code; this way we also learn whether it ended with an error.-m 10limits the check-in to ten seconds.0 3 * * * /usr/local/bin/backup.sh; curl -fsS -m 10 --retry 3 https://runcheck.de/a8k3m2x9q1/$? > /dev/null
-
Test it once by hand
Run the same line without the schedule once on the command line. In your account, “Waiting for the first check-in …” turns green, and from now on we keep watch.
/usr/local/bin/backup.sh; curl -fsS -m 10 --retry 3 https://runcheck.de/a8k3m2x9q1/$?
The ready-made lines for Linux, PHP, Python, Node.js, n8n, Make, Supabase and Vercel are on the page Cron job monitoring. Your own ping address appears in your account once you create the heartbeat, with the same lines ready to copy.
When something fails
What happens when a run fails
If the check-in is overdue – because the server was down, cron did not run or the script hangs – you get a message. If the script reports an exit code other than 0, we alert you right away, with the code in the message. There is one message per incident and an all-clear as soon as the next backup succeeds. The history shows every run with time and result.
FAQ
Common questions about Backup
- My backup consists of several commands. Which exit code counts?
- The one you send. Keep the first error in a variable and report it at the end, for example with restic:
#!/bin/sh restic backup /var/www /etc rc=$? restic forget --keep-daily 7 --prune || rc=$? curl -fsS -m 10 --retry 3 https://runcheck.de/a8k3m2x9q1/$rc > /dev/null
- rsync reports exit code 24. Is that a failure?
- rsync exits with 24 when files vanished during the transfer, rotated log files for example. For many backups that is harmless. If it should not be reported, set the code to 0 before checking in:
rsync -a /source/ /target/; rc=$?; [ $rc -eq 24 ] && rc=0; curl -fsS -m 10 --retry 3 https://runcheck.de/a8k3m2x9q1/$rc - Do you notice when the backup gets stuck?
- Yes, if you call
https://runcheck.de/a8k3m2x9q1/startat the beginning. Then we know a run has started, measure its duration and alert you if the end does not arrive in time. - Can I send the backup log along?
- Yes, via POST up to 10 KB, for example the last lines:
tail -n 20 /var/log/backup.log | curl -fsS -m 10 --data-binary @- https://runcheck.de/a8k3m2x9q1/$?. Do not put personal data in it.
Set up your heartbeat now
One heartbeat is free; you see its status in your account. Email alerts come with Plus (€17.88 a year), Slack, Teams and Discord with Unlimited. The first 14 days run on the Unlimited plan, no payment details needed.
Set up a heartbeat for free More about heartbeatsMore monitoring guides
Official documentation of Backup
The exit codes come from the documentation of rsync, restic and BorgBackup, as of October 2026. This guide comes from Cronjob.de and has no business relationship with these projects.