tips
20 tips Backup repositories
One command, setting or habit at a time about Backup repositories: what it does, the line to copy and a caveat or two.
Backup repositories 20
-
Show restic snapshots grouped by host, path or tag.
restic snapshots --group-by host,paths -
Searches the snapshots of a restic repository for files that match a pattern.
restic find "*.txt" -
Counts the data in a restic repository in four modes, from restore size to raw blobs.
restic stats -
Mounts a Borg repository or archive as a filesystem so you can copy files out.
borg mount /path/to/repo /mnt/borg -
Verifies a random or numbered slice of your restic repository by reading the actual data files.
restic -r /srv/restic-repo check --read-data-subset=10% -
Previews which restic snapshots a retention policy would delete without removing anything.
restic -r /srv/restic-repo forget --keep-daily 5 --dry-run -
Mounts a restic repository through FUSE so you can browse and copy files from every snapshot.
restic -r /srv/restic-repo mount /mnt/restic -
Restores a single file or folder from a restic snapshot into a directory of your choice.
restic -r /srv/restic-repo restore latest --target /tmp/restore --include /mnt/user/appdata/<app>/config.xml -
Writes a file or folder from a restic snapshot to stdout, ready for a pipe or redirect.
restic -r /srv/restic-repo dump latest /mnt/user/appdata/<app>/config.xml > config.xml -
Shows which files a restic backup would process, so you can test your excludes without making a snapshot.
restic -r /srv/restic-repo backup /mnt/user/appdata --dry-run -vv -
Makes restic skip any folder that contains a marker file you chose, such as .nobackup.
restic -r /srv/restic-repo backup /mnt/user/appdata --exclude-if-present .nobackup -
Keeps restic from crossing into other mounted filesystems when you back up a directory tree.
restic -r /srv/restic-repo backup --one-file-system / -
Copies snapshots from one restic repository into another, for example to keep an offsite second copy.
restic -r /srv/restic-repo-copy copy --from-repo /srv/restic-repo -
Frees the repository space that borg prune only marks as unused.
borg compact /path/to/repo -
Previews which borg archives a prune rule keeps and removes, without changing the repository.
borg prune -v --list --dry-run --keep-daily=7 --keep-weekly=4 /path/to/repo -
Verifies the stored data of your Borg archives instead of only their structure.
borg check --verify-data /path/to/repo -
Lists only the added, modified and unreadable files in a Borg backup run.
borg create --list --filter=AME /path/to/repo::{hostname}-{now} ~/Documents -
Lists files added, removed and changed between two archives in a Borg repository.
borg diff /path/to/repo::archive1 archive2 -
Reads, verifies and decrypts an archive as if restoring it, but writes no files to disk.
borg extract --dry-run /path/to/repo::my-files -
Runs a Borg repository check in time-limited pieces that resume where the last one stopped.
borg check --repository-only --max-duration=3600 /path/to/repo
Nothing in this filter yet.