[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible maintenance: use the correct filetype when cleaning up sessions

Holger Levsen gitlab at salsa.debian.org
Sat Sep 5 08:45:33 BST 2020



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


Commits:
a63a5cdd by Holger Levsen at 2020-09-05T09:45:26+02:00
reproducible maintenance: use the correct filetype when cleaning up sessions

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,26 @@ 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 {} \; || true)
+		if [ "$path" = "session" ] ; then
+			OLDSTUFF=$(find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type f -mtime +2 -exec ls -lad {} \; || true)
+		else
+			OLDSTUFF=$(find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type d -mtime +2 -exec ls -lad {} \; || true)
+		fi
 		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 {} \; || true
+				find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type f -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 {} \; || true
 			fi
-			OLDSTUFF=$(find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type d -mtime +2 -exec ls -lad {} \; || true)
+			if [ "$path" = "session" ] ; then
+				OLDSTUFF=$(find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type f -mtime +2 -exec ls -lad {} \; || true)
+			else
+				OLDSTUFF=$(find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type d -mtime +2 -exec ls -lad {} \; || true)
+			fi
 			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/a63a5cdd4ea4a4136cc15ac3c06b1cbe663cb726

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/a63a5cdd4ea4a4136cc15ac3c06b1cbe663cb726
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/ce7c0325/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list