Skip to content

borgmatic howto

This is for mnemonic purposes only.

Lists all backups you can restore from

borgmatic rlist

List all backups you can restore from (even when the current hostname differs from the backup's hostname)

borgmatic rlist --match-archives "*"

list contents of a bacukp for a specific archive for a specific repo in mnt/source/grafana.

borgmatic list --match-archives "*" --repo backupuser@nasofden2 --archive cntr1-2025-08-14T02:45:01.058077 --path mnt/source/grafana

Extract content from backup

borgmatic extract   --repository backupuser@nasofden2   --archive cntr1-2025-08-14T02:45:01.058077   --path mnt/source/grafana/jochen/grafana.db   --destination /tmp/restore

Mount specific archive

borgmatic -c config.yaml mount --mount-point /mnt/tmp --archive filer0-2025-09-12T02:16:01.411669

Dump a database from a containerized PostgreSQL instance on the host (handy for feeding a consistent snapshot into borgmatic, or for ad-hoc restores):

podman exec -i psql0 pg_dump -U postgres gitea1 > gitea1_dump.sql

Extract a database dump straight out of a borgmatic backup, running the extract inside the borgmatic container with ~ as the working directory so restored files land in the container home:

podman exec -i -w ~ borgmatic0 borgmatic extract --repository cntr-nuern1.t.libcom.de_borgbase0 --archive latest