Skip to content
HookPulse

Monitor PostgreSQL backups (pg_dump) with HookPulse

End the pg_dump line in the crontab with one curl. HookPulse alerts you when the nightly dump stops or fails.

Updated

1Create the monitor

Add a routine named postgres-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.

2Add the check-in to the dump line

Run crontab -e. pg_dump -Fc writes one compressed file, and $? sends its exit status: 0 is a success. In a crontab, % starts a new line, so the date uses \%.

# m h dom mon dow  command
0 3 * * * pg_dump -Fc -f /backups/app-$(date +\%F).dump app; curl -fsS -m 10 --retry 3 "https://hookpulse.net/in/YOUR_ID/$?"

3Run it once

Run pg_dump once by hand with the same options. The routine shows the first check-in. From then on, a missed or failed run sends the alert.