Prune backups
This commit is contained in:
parent
8e6cbb69ff
commit
5d8238e029
@ -54,9 +54,26 @@ backup() {
|
||||
for dir in "$@"; do
|
||||
echo "- $dir"
|
||||
done
|
||||
# Back up everything in the $DIRS array (which was passed as args)
|
||||
/opt/restic-wrapper \
|
||||
backup \
|
||||
"$@"
|
||||
# In addition, we should also prune our backups
|
||||
# https://restic.readthedocs.io/en/stable/060_forget.html
|
||||
# --keep-daily n Keeps daily backups for the last n days
|
||||
# --keep-weekly n Keeps weekly backups for the last n weeks
|
||||
# --keep-montly n Keeps monthly backups for the last n months
|
||||
# --keep-tag foo Keeps all snapshots tagged with "foo"
|
||||
# --host "$HOSTNAME" Only act on *our* snapshots. We don't care about other machines'
|
||||
# --prune Remove orphaned blobs when we remove snapshots
|
||||
/opt/restic-wrapper \
|
||||
forget \
|
||||
--keep-daily 7 \
|
||||
--keep-weekly 4 \
|
||||
--keep-monthly 6 \
|
||||
--keep-tag noremove \
|
||||
--host "$HOSTNAME" \
|
||||
--prune
|
||||
else
|
||||
dir="$@"
|
||||
echo "- $dir"
|
||||
|
Loading…
x
Reference in New Issue
Block a user