Flaxplax

Personal documentation

Restic

Restic is a backup tool

Installation

Alpine

apk add restic

Arch

pacman -S restic

Debian

apt install restic

Create repo for backup

Local repo

restic init --repo <path to repo>

Enter a password for your repo

don’t forget the password

With sftp

First set up ssh keys for passwordless ssh. It will not work without ssh keys

restic -r sftp:user@host:<path to repo> init

Enter a password for your repo

don’t forget the password

Backup

How to backup

restic -r <path to repo> --verbose backup <path to folder/file>

It is possible to run this command without the --verbose flag. It will only show less output.

List backups

restic -r <path to repo> snapshots

Filter with --path flag

restic -r <path to repo> snapshots --path="<path to folder/file>"

Restore

Restore from snapshot

restic -r <path to repo> restore <snapshot id> --target <target path>

Remove snapshots

Remove single snapshot

restic -r <path to repo> forget <snapshot id>
restic -r <path to repo> prune

You use prune to delete data after snapshot has been removed.

Title: Restic

Author: Flaxplax

Publish Date: 8, Jan 2022

Last updated: 8, Jan 2022