[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible maintenance: automatically cleanup leftovers from diffoscope schroot sessions

Holger Levsen gitlab at salsa.debian.org
Sat Sep 5 00:43:01 BST 2020



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


Commits:
dacf5211 by Holger Levsen at 2020-09-05T01:42:36+02:00
reproducible maintenance: automatically cleanup leftovers from diffoscope schroot sessions

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

- - - - -


1 changed file:

- bin/reproducible_maintenance.sh


Changes:

=====================================
bin/reproducible_maintenance.sh
=====================================
@@ -415,6 +415,33 @@ if [ ! -z "$OLDSTUFF" ]; then
 	DIRTY=true
 fi
 
+# remove too old schroot session data from diffoscope
+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 {} \;)
+	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 rm -v {} \;
+		else
+			find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type d -mtime +2 -exec rmdir -v {} \;
+		fi
+		OLDSTUFF=$(find "$dir" -name "jenkins-reproducible-*-diffoscope-*" -mindepth 1 -maxdepth 1 -type d -mtime +2 -exec ls -lad {} \;)
+		if [ ! -z "$OLDSTUFF" ]; then
+			echo
+			echo "Warning: Tried, but failed to delete these in $dir:"
+			echo "$OLDSTUFF"
+			echo "Manual cleanup needed"
+		fi
+		echo
+		DIRTY=true
+	fi
+done
+
 # find old schroots
 echo "$(date -u) - Removing schroots older than 3 days."
 regex="/schroots/(reproducible-.+-[0-9]{1,5}|schroot-install-.+)"



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

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


More information about the Qa-jenkins-scm mailing list