Core Commands Cheatsheet
# set repository + password
export RESTIC_REPOSITORY="/path/to/repo"
export RESTIC_PASSWORD_FILE="/etc/restic/password"
# initialize repository
restic init
# create backup
restic backup /srv/data --tag daily --host app-01
# list snapshots
restic snapshots
# filter snapshots
restic snapshots --tag daily
restic snapshots --host app-01
# inspect repository size
restic stats
# list files in snapshot
restic ls latest
# restore latest snapshot
restic restore latest --target /restore/lab
Common Gotchas
| Gotcha | Why it matters | Fix |
|---|---|---|
| Wrong repository | you back up into the wrong place | print RESTIC_REPOSITORY before running backup |
| No tags/host | hard to find the right snapshot later | always use --tag and --host |
| No restore test | you do not know restores work | restore a small path after setup |