[Qa-jenkins-scm] [jenkins.debian.net] 01/02: reproducible: cleanup old schroot sessions in maintenance job
Holger Levsen
holger at moszumanska.debian.org
Wed Sep 9 15:42:24 UTC 2015
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch master
in repository jenkins.debian.net.
commit acaeeaa2ca4c34919a287bd7901011c49288cf56
Author: Holger Levsen <holger at layer-acht.org>
Date: Wed Sep 9 17:40:05 2015 +0200
reproducible: cleanup old schroot sessions in maintenance job
---
bin/reproducible_maintenance.sh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh
index f2a7fb3..5edbc6a 100755
--- a/bin/reproducible_maintenance.sh
+++ b/bin/reproducible_maintenance.sh
@@ -51,6 +51,14 @@ if [ ! -z "$OLDSTUFF" ] ; then
DIRTY=true
fi
+# remove old and unused schroot sessions
+ps fax|grep -v grep |grep schroot || for i in $(sudo schroot --all-sessions -l ) ; do ps fax|grep -v grep |grep schroot || sudo schroot -c $i -e ; done
+# to explain this:
+# first, check if no process using "schroot" is running...
+# then loop through all schroot sessions
+# for each session
+# check that schroot is still not run, and then, delete the session
+
# find old schroots
OLDSTUFF=$(find /schroots/ -maxdepth 1 -type d -regextype posix-extended -regex "/schroots/reproducible-.*-[0-9]{1,5}" -mtime +2 -exec ls -lad {} \;)
if [ ! -z "$OLDSTUFF" ] ; then
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git
More information about the Qa-jenkins-scm
mailing list