Merge "Skip purged borg backups during backup pruning"
This commit is contained in:
commit
52f864727e
@ -26,10 +26,15 @@ pushd /opt/backups
|
||||
for u in borg-*; do
|
||||
BORG_BASE=/opt/backups/$u
|
||||
BORG_REPO=${BORG_BASE}/backup
|
||||
BORG_RETIRED=${BORG_BASE}/.retired
|
||||
|
||||
_prune_flags='--keep-daily 7 --keep-weekly 4 --keep-monthly 12'
|
||||
_retired=''
|
||||
if [[ -f ${BORG_BASE}/.retired ]]; then
|
||||
if [[ -f "${BORG_RETIRED}" ]] && [[ ! -d "${BORG_REPO}" ]]; then
|
||||
# This repo was retired and purged. We don't need to prune it.
|
||||
echo "$(date) Skipping ${BORG_REPO} it is retired and purged."
|
||||
continue
|
||||
elif [[ -f "${BORG_RETIRED}" ]]; then
|
||||
_prune_flags='--keep-daily 1'
|
||||
_retired=' (retired)'
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user