Ballast

Test a restore

A backup only counts if you can get your files back. Restore one file, open it, and record that in Ballast.

You run these on your server. Ballast doesn't run them and can't: it only reads.

Each command restores one file to /tmp and leaves your data alone. Ballast shows these commands filled in for your own backup, under More details › Restore test. Then choose Record a restore test. Ballast only records what you tell it.

restic

env RESTIC_PASSWORD_FILE=/etc/restic/password restic --no-lock -r /srv/backups/restic restore latest --target /tmp/ballast-restore-test --include /srv/data/note.txt

Borg

Find the newest archive, then extract into a test folder. Paths have no leading slash.

export BORG_PASSCOMMAND="cat /etc/borg-passphrase"
borg --bypass-lock list --last 1 --short /srv/backups/borg
mkdir -p /tmp/ballast-restore-test && cd /tmp/ballast-restore-test
borg --bypass-lock extract /srv/backups/borg::ARCHIVE_NAME srv/data/note.txt

borgmatic

This takes Borg's lock, so it needs an account that can write to the repository.

borgmatic extract --archive latest --destination /tmp/ballast-restore-test --path srv/data/note.txt

Kopia

The first command lists snapshots. Each line has an ID that starts with k: use it in the second.

kopia snapshot list --all
kopia snapshot restore OBJECT_ID/note.txt /tmp/ballast-restore-test

ZFS

Snapshots appear as ordinary folders under the mount point. This one isn't tested in our lab, which has no ZFS, and it assumes the dataset is mounted at its own name.

ls /tank/photos/.zfs/snapshot/
cp /tank/photos/.zfs/snapshot/SNAPSHOT_NAME/note.txt /tmp/ballast-restore-test

A clean scrub shows that the data reads back, not that a restore works, so it's worth doing this as well.

Then check it

Open the file, or compare it with the original. Write down what you restored and how you checked, for example "restored photos/2024-03 to /tmp, checksums matched". Delete /tmp/ballast-restore-test afterwards.