Monitor BorgBackup jobs with HookPulse check-ins
A small script runs borg create and prune, then sends the exit status to HookPulse, warnings included.
Updated
1Create the monitor
Add a routine named borg-backup and set how often the job runs. Its page shows the check-in URL: use it in place of https://hookpulse.net/in/YOUR_ID.
2Write the backup script
borg exits with 1 when the backup ends with warnings. HookPulse reports any status other than 0 as a failure, so warnings reach you too.
#!/bin/sh
# /usr/local/bin/borg-backup.sh
export BORG_REPO=/srv/borg-repo
export BORG_PASSCOMMAND="cat /root/.borg-passphrase"
borg create --compression zstd ::'{hostname}-{now}' /srv/data && borg prune --keep-daily 7 --keep-weekly 4
curl -fsS -m 10 --retry 3 "https://hookpulse.net/in/YOUR_ID/$?"3Schedule the script
Make it executable with chmod +x, then add this line to the crontab.
0 3 * * * /usr/local/bin/borg-backup.sh4Run it once
Run the script once. The routine shows the first check-in. From then on, a missed or failed run sends the alert.