[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] properly delete old schroot overlays

Holger Levsen (@holger) gitlab at salsa.debian.org
Mon Jun 21 23:44:45 BST 2021



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


Commits:
99ca0c3d by Holger Levsen at 2021-06-22T00:44:28+02:00
properly delete old schroot overlays

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

- - - - -


2 changed files:

- bin/reproducible_maintenance.sh
- hosts/jenkins/etc/sudoers.d/jenkins


Changes:

=====================================
bin/reproducible_maintenance.sh
=====================================
@@ -410,10 +410,10 @@ if [ "$HOSTNAME" = "$MAINNODE" ] ; then
 		dir=/var/lib/schroot/$path/
 		if [ "$path" = "session" ] ; then
 			FILETYPE=f
-			RM=rm
+			RM_OPTIONS="-v"
 		else
 			FILETYPE=d
-			RM=rmdir
+			RM_OPTIONS="-rv --one-file-system"
 		fi
 		OLDSTUFF=$(find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type $FILETYPE -mtime +1 -exec ls -lad {} \; || true)
 		if [ ! -z "$OLDSTUFF" ]; then
@@ -422,7 +422,7 @@ if [ "$HOSTNAME" = "$MAINNODE" ] ; then
 			echo "$OLDSTUFF" | sed "s#$dir#./#g"
 
 			echo
-			find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type $FILETYPE -mtime +1 -exec sudo $RM -v {} \; || true
+			find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type $FILETYPE -mtime +1 -exec sudo rm $RM_OPTIONS {} \; || true
 			OLDSTUFF=$(find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type $FILETYPE -mtime +1 -exec ls -lad {} \; || true)
 			if [ ! -z "$OLDSTUFF" ]; then
 				echo


=====================================
hosts/jenkins/etc/sudoers.d/jenkins
=====================================
@@ -23,8 +23,8 @@ jenkins ALL=  \
 	/bin/rm -rf --one-file-system /var/lib/sbuild/build/*, \
 	/bin/rm -rf --one-file-system /tmp/*, \
 	/bin/rm -rv --one-file-system /tmp/*, \
+	/bin/rm -rv --one-file-system /var/lib/schroot/*, \
 	/bin/rm -v /var/lib/schroot/*, \
-	/bin/rmdir -v /var/lib/schroot/*, \
 	/bin/mv /chroots/* /schroots/*, \
 	/bin/mv /schroots/* /schroots/*, \
 	/bin/umount -l /chroots/*, \



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

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/99ca0c3da556fcb05f0f708c50d91120d20fe1f8
You're receiving this email because of your account on salsa.debian.org.


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


More information about the Qa-jenkins-scm mailing list