borg-backup: prune after successful backup
After a successful backup run, perform a prune step to slim down to keep the last 7 days, the last 4 weeks and the last 12 months of backups. Change-Id: I98d60319e333d22b3b48214d3dd9136e255a341f
This commit is contained in:
parent
19ed7fd76d
commit
dad4845470
@ -43,6 +43,13 @@ ${BORG} create \
|
||||
|
||||
backup_exit=$?
|
||||
|
||||
if [ ${backup_exit} -eq 0 ]; then
|
||||
info "Running prune"
|
||||
${BORG} prune --verbose --list --prefix '{hostname}-' \
|
||||
--show-rc --keep-daily 7 --keep-weekly 4 --keep-monthly 12
|
||||
backup_exit=$?
|
||||
fi
|
||||
|
||||
if [ ${backup_exit} -eq 0 ]; then
|
||||
info "Backup finished successfully"
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user