Check in after a backup succeeds
Monitor restic, borg, pg_dump and rsync from a scheduled backup. Confirm success with a BotPings check-in and report a nonzero exit as a failure.
Shell · Backups · 3 min · Servers and scripts
Before you start
Create a check-in for the expected backup completion time. Store its URL in BOTPINGS_CHECK_IN_URL. Test with a disposable backup destination.
Steps
Wrap the backup command
This wrapper accepts the backup program and its arguments. Use the command already verified for your restic repository, borg archive, pg_dump destination or rsync destination.
#!/bin/sh
set -eu
if "$@"; then
curl -fsS --max-time 15 "$BOTPINGS_CHECK_IN_URL"
else
status=$?
curl -fsS --max-time 15 "$BOTPINGS_CHECK_IN_URL/fail" || true
exit "$status"
fiSchedule the wrapper
Put the wrapper before the backup command in your schedule. If your workflow requires verification after copying, make the job succeed only after verification.
Check the expected completion time
Verify the check-in is due after your longest normal run and that its grace period covers routine variation.
Test it
Run a disposable successful backup and then a failing command. See Last check-in update after success and a failure alert after the second run.

If it doesn’t work
- Command exited successfully but produced no backup. Verify the backup and configure the job to fail when validation fails.
- Permission error. Run as the scheduler’s account and inspect the destination permissions.
- Check-in is late. Compare the scheduled start and usual run time with the deadline.
Related guides
Checked with BotPings 1.0 in a local test environment, November 2026.