Update README.md

This commit is contained in:
Nicco 2019-12-04 23:39:19 +01:00 committed by GitHub
parent 96b63c744b
commit 3b7062f733
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 14 deletions

View File

@ -132,7 +132,7 @@ backends:
B2_ACCOUNT_KEY: backblaze_account_key B2_ACCOUNT_KEY: backblaze_account_key
``` ```
## Pruning and snapshot policies ### Pruning and snapshot policies
Autorestic supports declaring snapshot policies for location to avoid keeping old snapshot around if you don't need them. Autorestic supports declaring snapshot policies for location to avoid keeping old snapshot around if you don't need them.
@ -143,24 +143,20 @@ locations:
etc: etc:
from: /etc from: /etc
to: local to: local
keep: options:
# options matches the --keep-* options used in the restic forget CLI forget:
# cf https://restic.readthedocs.io/en/latest/060_forget.html#removing-snapshots-according-to-a-policy keep-last: 5 # always keep at least 5 snapshots
last: 5 # always keep at least 5 snapshots keep-hourly: 3 # keep 3 last hourly shapshots
hourly: 3 # keep 3 last hourly shapshots keep-daily: 4 # keep 4 last daily shapshots
daily: 4 # keep 4 last daily shapshots keep-weekly: 1 # keep 1 last weekly shapshots
weekly: 1 # keep 1 last weekly shapshots keep-monthly: 12 # keep 12 last monthly shapshots
monthly: 12 # keep 12 last monthly shapshots keep-yearly: 7 # keep 7 last yearly shapshots
yearly: 7 # keep 7 last yearly shapshots keep-within: "2w" # keep snapshots from the last 2 weeks
within: "2w" # keep snapshots from the last 2 weeks
``` ```
Pruning can be triggered using `autorestic forget -a`, for all locations, or selectively with `autorestic forget -l <location>`. **please note that contrary to the restic CLI, `restic forget` will call `restic prune` internally.** Pruning can be triggered using `autorestic forget -a`, for all locations, or selectively with `autorestic forget -l <location>`. **please note that contrary to the restic CLI, `restic forget` will call `restic prune` internally.**
Run with the `--dry-run` flag to only print information about the process without actually pruning the snapshots. This is especially useful for debugging or testing policies: Run with the `--dry-run` flag to only print information about the process without actually pruning the snapshots. This is especially useful for debugging or testing policies:
``` ```
$ autorestic forget -a --dry-run --verbose $ autorestic forget -a --dry-run --verbose