Skip to content

backupctl reference

backupctl wraps a backup command: it pings /start, runs the command, verifies the result, then pings /success or /fail. One static binary, zero non-stdlib dependencies.

Terminal window
backupctl run --url <base|ping url> [--key <key>] [checks...] -- <command...>

--url accepts a ping base (https://backpulse.aniicrite.dev, --key required) or a full ping URL (.../ping/<key>[/start|/success|/fail]). BACKPULSE_URL and BACKPULSE_PING_KEY are the flag defaults, so cron lines stay short.

AdapterVerifies
(none)exit code matches --expect-exit (default 0)
resticnewest snapshot in the repo is within --max-age
pgdumpfile checks below, plus custom-format magic for -Fc dumps
rcloneexit code plus an independent check of --remote
file checks (--path)file exists, mtime within --max-age, size above --min-size, gzip magic for .gz
FlagMeaning
--urlping base or full ping URL (or BACKPULSE_URL)
--keyping key when --url is a base (or BACKPULSE_PING_KEY)
--adapterrestic, pgdump, rclone, or empty for exit-code only
--pathartifact to verify (file checks)
--max-agemax acceptable artifact/snapshot age, e.g. 26h
--min-sizeminimum artifact bytes
--restic-reporepo override instead of the environment
--remoteremote path for the rclone adapter
--expect-exitaccepted command exit code (default 0)
CodeMeaning
0command behaved and every check passed (/success)
Ncommand exited N (≠ --expect-exit), pinged /fail
1command was fine but a check failed, pinged /fail
2usage error (bad url/key/adapter, missing command)