[Git][qa/jenkins.debian.net][master] rdn: bugfix: actually delete (some) old database backups

Holger Levsen (@holger) gitlab at salsa.debian.org
Fri Sep 25 10:36:58 BST 2026



Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
859227c0 by Holger Levsen at 2026-09-25T11:36:51+02:00
rdn: bugfix: actually delete (some) old database backups

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


1 changed file:

- bin/rebuilderd_db_backup_compress.sh


Changes:

=====================================
bin/rebuilderd_db_backup_compress.sh
=====================================
@@ -29,9 +29,13 @@ for DIR in /srv/rebuilderd/*/stats/db-backup/ ; do
 	# loop through all months except the last two months
 	for MONTH_DIRECTORY in $(find db-back-* -type d | cut -d '-' -f1-4 | sort -u | grep -v -E "($THIS_MONTH|$LAST_MONTH|$LAST_2_MONTHS)") ; do
 		# keep the last backup of each month
-		KEEP=$(find ${MONTH_DIRECTORY}-* -type d | sort -u | tail -1)
+		KEEP=$(find ${MONTH_DIRECTORY}-* -type f | sort -u | tail -1)
 		# delete the rest
 		find ${MONTH_DIRECTORY}-* -name "*.zst" -type f | grep -v $KEEP | xargs -r rm
+		# TODO:
+		# if the backup is older than 12+current month, only keep backups from jan, apr, july, october (so backups from 2024 atm, which we dont have)
+		:
+		# cleanup old empty directories too
 		rmdir $MONTH_DIRECTORY 2>/dev/null || true
 	done
 done



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/859227c0e151396af142b6d18b10af1a96f82c17

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/859227c0e151396af142b6d18b10af1a96f82c17
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20260925/59badc3e/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list