2025-03-14 21:59:59 -06:00
|
|
|
# restic
|
|
|
|
|
|
|
|
|
|
> A fast, secure and secure backup program.
|
2025-12-16 10:20:31 -07:00
|
|
|
> More information: <https://restic.readthedocs.io/en/stable/manual_rest.html#usage-help>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Initialize a backup repository in the specified local directory:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`restic init {{[-r|--repo]}} {{path/to/repository}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Backup a directory to the repository:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`restic {{[-r|--repo]}} {{path/to/repository}} backup {{path/to/directory}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Show backup snapshots currently stored in the repository:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`restic {{[-r|--repo]}} {{path/to/repository}} snapshots`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Restore a specific backup snapshot to a target directory:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`restic {{[-r|--repo]}} {{path/to/repository}} restore {{latest|snapshot_id}} --target {{path/to/target}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Restore a specific path from a specific backup to a target directory:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`restic {{[-r|--repo]}} {{path/to/repository}} restore {{snapshot_id}} --target {{path/to/target}} --include {{path/to/restore}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Clean up the repository and keep only the most recent snapshot of each unique backup:
|
|
|
|
|
|
|
|
|
|
`restic forget --keep-last 1 --prune`
|