Skip to main content

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

GotchaWhy it mattersFix
Wrong repositoryyou back up into the wrong placeprint RESTIC_REPOSITORY before running backup
No tags/hosthard to find the right snapshot lateralways use --tag and --host
No restore testyou do not know restores workrestore a small path after setup

Next