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:
Ian Wienand 2021-01-20 13:56:38 +11:00
parent 19ed7fd76d
commit dad4845470

View File

@ -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