summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_maintenance.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2017-04-26 12:59:41 +0200
committerHolger Levsen <holger@layer-acht.org>2017-04-26 12:59:41 +0200
commit1129233bbbefdfa083c76f0e386d8be04100ca08 (patch)
treecb9da10b65052199760d4a8a2978af964f316489 /bin/reproducible_maintenance.sh
parent8634f957113ab2596e58bf8c4c2a3708b74dd6a5 (diff)
downloadjenkins.debian.net-1129233bbbefdfa083c76f0e386d8be04100ca08.tar.xz
reproducible Debian: let maintenance job cleanup old build service logfiles
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/reproducible_maintenance.sh')
-rwxr-xr-xbin/reproducible_maintenance.sh21
1 files changed, 11 insertions, 10 deletions
diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh
index 066f968c..a88c2afe 100755
--- a/bin/reproducible_maintenance.sh
+++ b/bin/reproducible_maintenance.sh
@@ -207,16 +207,17 @@ if [ -d /srv/workspace/pbuilder/ ] ; then
fi
# delete build services logfiles
-if [ -d /var/lib/jenkins/userContent/reproducible/debian/build_service/ ] ; then
- echo "$(date -u) - Deleting pbuilder build directories, older than 3 days."
- OLDSTUFF=$(find /var/lib/jenkins/userContent/reproducible/debian/build_service/ -maxdepth 2 -regex '.*/[0-9]+' -type d -mtime +2 -exec ls -lad {} \; || true)
- if [ ! -z "$OLDSTUFF" ] ; then
- echo
- echo "Old pbuilder build directories found in /var/lib/jenkins/userContent/reproducible/debian/build_service/"
- echo -n "$OLDSTUFF"
- find /var/lib/jenkins/userContent/reproducible/debian/build_service/ -maxdepth 2 -regex '.*/[0-9]+' -type d -mtime +2 -exec sudo rm -rf --one-file-system {} \; || true
- echo
- DIRTY=true
+if [ "$HOSTNAME" = "$MAINNODE" ] ; then
+ if [ -d /var/lib/jenkins/userContent/reproducible/debian/build_service/ ] ; then
+ echo "$(date -u) - Deleting logfiles from build services directories, older than 3 days."
+ OLDSTUFF=$(find /var/lib/jenkins/userContent/reproducible/debian/build_service/ -maxdepth 2 -regex '.*/[0-9]+' -type d -mtime +2 -exec ls -lad {} \; || true)
+ if [ ! -z "$OLDSTUFF" ] ; then
+ echo
+ echo "Old logfiles cleaned in /var/lib/jenkins/userContent/reproducible/debian/build_service/"
+ echo -n "$OLDSTUFF"
+ find /var/lib/jenkins/userContent/reproducible/debian/build_service/ -maxdepth 2 -regex '.*/[0-9]+' -type d -mtime +2 -exec sudo rm -rf --one-file-system {} \; || true
+ echo
+ fi
fi
fi