tldr/pages/common/restic.md

29 lines
913 B
Markdown
Raw Normal View History

2018-02-05 09:18:52 +00:00
# restic
> A fast, secure and secure backup program.
> More information: <https://restic.net>.
2018-02-05 09:18:52 +00:00
- Initialize a backup repository in the specified local directory:
`restic init --repo {{path/to/repository}}`
2018-02-05 09:18:52 +00:00
- Backup a directory to the repository:
2018-02-05 09:18:52 +00:00
`restic --repo {{path/to/repository}} backup {{path/to/directory}}`
2018-02-05 09:18:52 +00:00
- Show backup snapshots currently stored in the repository:
`restic --repo {{path/to/repository}} snapshots`
2018-02-05 09:18:52 +00:00
- Restore a specific backup snapshot to a target directory:
2021-07-17 14:10:38 +01:00
`restic --repo {{path/to/repository}} restore {{latest|snapshot_id}} --target {{path/to/target}}`
2018-02-05 09:18:52 +00:00
- Restore a specific path from a specific backup to a target directory:
2021-07-17 14:10:38 +01:00
`restic --repo {{path/to/repository}} restore {{snapshot_id}} --target {{path/to/target}} --include {{path/to/restore}}`
2018-02-05 09:18:52 +00:00
- Clean up the repository and keep only the most recent snapshot of each unique backup:
`restic forget --keep-last 1 --prune`