[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible maintenance: gracefully deal with failures

Holger Levsen gitlab at salsa.debian.org
Sat Sep 5 08:34:51 BST 2020



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


Commits:
06a62ded by Holger Levsen at 2020-09-05T09:34:40+02:00
reproducible maintenance: gracefully deal with failures

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

- - - - -


1 changed file:

- bin/reproducible_maintenance.sh


Changes:

=====================================
bin/reproducible_maintenance.sh
=====================================
@@ -420,18 +420,18 @@ if [ "$HOSTNAME" = "$MAINNODE" ] ; then
 	echo "$(date -u) - Removing diffoscope schroot session data older than 3 days."
 	for path in session union/underlay union/overlay ; do
 		dir=/var/lib/schroot/$path/
-		OLDSTUFF=$(find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type d -mtime +2 -exec ls -lad {} \;)
+		OLDSTUFF=$(find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type d -mtime +2 -exec ls -lad {} \; || true)
 		if [ ! -z "$OLDSTUFF" ]; then
 			echo
 			echo "data in $dir older than 3 days found, which will be deleted:"
 			echo "$OLDSTUFF"
 			echo
 			if [ "$path" = "session" ] ; then
-				find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type d -mtime +2 -exec sudo rm -v {} \;
+				find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type d -mtime +2 -exec sudo rm -v {} \; || true
 			else
-				find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type d -mtime +2 -exec sudo rmdir -v {} \;
+				find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type d -mtime +2 -exec sudo rmdir -v {} \; || true
 			fi
-			OLDSTUFF=$(find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type d -mtime +2 -exec ls -lad {} \;)
+			OLDSTUFF=$(find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type d -mtime +2 -exec ls -lad {} \; || true)
 			if [ ! -z "$OLDSTUFF" ]; then
 				echo
 				echo "Warning: Tried, but failed to delete these in $dir:"



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

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/06a62dedc4aa37414e8332bad7ad9edcb3270760
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/20200905/84af24f8/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list