Skip to main content

Commands

This module provides a dedicated reference for every essential Restic command. Each guide covers syntax, key flags, practical examples, common pitfalls, and examples with output.

The Golden Rule

Always verify your backups. A backup is only a backup once you have successfully restored from it.

Learning-Path Lessons

These guides teach the core operational loop through grouped workflows:

LessonOutcome
Initialization & BackupSetup a repo and create your first snapshots
Navigation & SearchFind exactly what you need in your backup history
Integrity & ValidationEnsure your repository is healthy and catch growth trends
Retention & CleanupAutomate the pruning of old data safely

Command Reference

Setup and Inspection

CommandWhat It Does
initInitialize a new Restic repository
statsShow storage totals and deduplication efficiency
versionPrint version information

Data Operations

CommandWhat It Does
backupCreate a new snapshot of local data
restoreExtract files/directories from a snapshot
mountBrowse snapshots as a local filesystem (FUSE)

Listing and Discovery

CommandWhat It Does
snapshotsList all available restore points
lsList files inside a specific snapshot
findSearch for specific files across snapshots
diffCompare two snapshots to see what changed
catPrint a file from a snapshot to stdout

Maintenance and Cleanup

CommandWhat It Does
checkVerify repository structural integrity and data
forgetRemove old snapshots according to retention rules
prunePhysically delete unreferenced data from storage
unlockRemove stale lock files after crashed operations

Quick Drill

Initialize a local repo and run your first backup in 30 seconds:

# Setup
export RESTIC_REPOSITORY="/tmp/restic-repo"
export RESTIC_PASSWORD="password"

# Execution
restic init
restic backup /etc --tag initial
restic snapshots