# Monitor BorgBackup jobs with HookPulse check-ins

A small script runs borg create and prune, then sends the exit status to HookPulse, warnings included.

HookPulse · Updated 2026-10-14

## Step 1. Create 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.

## Step 2. Write 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.

```sh
#!/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/$?"
```

## Step 3. Schedule the script

Make it executable with chmod +x, then add this line to the crontab.

```sh
0 3 * * * /usr/local/bin/borg-backup.sh
```

## Step 4. Run it once

Run the script once. The routine shows the first check-in. From then on, a missed or failed run sends the alert.

[Create the monitor](https://hookpulse.net/?routine=borg-backup&every=86400#routines)

[Monitor BorgBackup jobs with HookPulse check-ins](https://hookpulse.net/guides/borg)
