From 549ec0b9393d12b6e82d230ed63ae1d9fe7af0ff Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Fri, 11 Dec 2015 15:19:37 +0100 Subject: reproducible: only do pbuilder maintenance if its used --- bin/reproducible_maintenance.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh index 1e2c64e3..8f8a2b31 100755 --- a/bin/reproducible_maintenance.sh +++ b/bin/reproducible_maintenance.sh @@ -122,15 +122,17 @@ if [ ! -z "$OLDSTUFF" ] ; then fi # delete old pbuilder build directories -echo "$(date -u) - Deleting pbuilder build directories, older than 2 days." -OLDSTUFF=$(find /srv/workspace/pbuilder/ -maxdepth 1 -regex '.*/[0-9]+' -type d -mtime +1 -exec ls -lad {} \; || true) -if [ ! -z "$OLDSTUFF" ] ; then - echo - echo "Old temp directories found in $REP_RESULTS" - echo -n "$OLDSTUFF" - find /srv/workspace/pbuilder/ -maxdepth 1 -regex '.*/[0-9]+' -type d -mtime +1 -exec sudo rm -rf --one-file-system {} \; || true - echo - DIRTY=true +if [ -d /srv/workspace/pbuilder/ ] ; then + echo "$(date -u) - Deleting pbuilder build directories, older than 2 days." + OLDSTUFF=$(find /srv/workspace/pbuilder/ -maxdepth 1 -regex '.*/[0-9]+' -type d -mtime +1 -exec ls -lad {} \; || true) + if [ ! -z "$OLDSTUFF" ] ; then + echo + echo "Old temp directories found in $REP_RESULTS" + echo -n "$OLDSTUFF" + find /srv/workspace/pbuilder/ -maxdepth 1 -regex '.*/[0-9]+' -type d -mtime +1 -exec sudo rm -rf --one-file-system {} \; || true + echo + DIRTY=true + fi fi # remove old and unused schroot sessions -- cgit v1.2.3-54-g00ecf