2018-02-05 09:18:52 +00:00
|
|
|
# restic
|
|
|
|
|
2020-02-11 17:53:43 +00:00
|
|
|
> A backup program that aims to be fast, secure and efficient.
|
2019-05-23 11:56:50 +01:00
|
|
|
> More information: <https://restic.net>.
|
2018-02-05 09:18:52 +00:00
|
|
|
|
|
|
|
- Initialize a backup repository in the specified local directory:
|
|
|
|
|
2021-07-10 19:36:37 +01:00
|
|
|
`restic init --repo {{path/to/repository}}`
|
2018-02-05 09:18:52 +00:00
|
|
|
|
2019-02-11 18:00:49 +00:00
|
|
|
- Backup a directory to the repository:
|
2018-02-05 09:18:52 +00:00
|
|
|
|
2021-07-10 19:36:37 +01: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:
|
|
|
|
|
2021-07-10 19:36:37 +01:00
|
|
|
`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
|
|
|
|
2018-11-24 10:10:08 +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-11-24 10:10:08 +00:00
|
|
|
|
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`
|