Nightly pg_dump
Dump the database, require the fresh dump to exist and be sane, ping the
check. The .gz suffix additionally asserts real gzip content, so a
truncated or empty dump fails the run instead of silently succeeding:
export BACKPULSE_URL=https://backpulse.aniicrite.devexport BACKPULSE_PING_KEY='<check-key>'
# crontab: every night at 02:000 2 * * * /usr/local/bin/backupctl run \ --path /var/backups/mydb.sql.gz --max-age 26h --min-size 1048576 -- \ /bin/sh -c 'pg_dump -Fc mydb | gzip > /var/backups/mydb.sql.gz'Or with the pgdump preset β same checks, plus a format-magic assertion when
the file is a -Fc custom-format dump:
0 2 * * * /usr/local/bin/backupctl run --adapter pgdump \ --path /var/backups/mydb.dump --max-age 26h --min-size 1048576 -- \ pg_dump -Fc mydb -f /var/backups/mydb.dump--min-size is your tripwire for the classic silent failure: a dump that
βranβ but wrote almost nothing. Set it just under your smallest healthy dump.