diff options
author | Holger Levsen <holger@layer-acht.org> | 2017-04-26 12:59:41 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2017-04-26 12:59:41 +0200 |
commit | 1129233bbbefdfa083c76f0e386d8be04100ca08 (patch) | |
tree | cb9da10b65052199760d4a8a2978af964f316489 /bin/reproducible_maintenance.sh | |
parent | 8634f957113ab2596e58bf8c4c2a3708b74dd6a5 (diff) | |
download | jenkins.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-x | bin/reproducible_maintenance.sh | 21 |
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 |