diff --git a/playbooks/roles/borg-backup-server/files/prune-borg-backups.sh b/playbooks/roles/borg-backup-server/files/prune-borg-backups.sh index 0ed9142b5a..af6b684dc6 100644 --- a/playbooks/roles/borg-backup-server/files/prune-borg-backups.sh +++ b/playbooks/roles/borg-backup-server/files/prune-borg-backups.sh @@ -28,7 +28,9 @@ for u in borg-*; do # Look at all archives and strip the timestamp, leaving just the archive names # We limit the prune by --prefix so each archive is considered separately - archives=$(/opt/borg/bin/borg list ${BORG_REPO} | awk '{$1 = substr($1, 0, length($1)-20); print $1}' | sort | uniq) + # Long-running aborted backups might leave a ".checkpoint" archive around; ignore + # these as prune will remove them automatically + archives=$(/opt/borg/bin/borg list ${BORG_REPO} | awk '$1 !~ /\.checkpoint$/ { print substr($1, 0, length($1)-20) }' | sort | uniq) for prefix in ${archives}; do