summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-12-11 15:19:37 +0100
committerHolger Levsen <holger@layer-acht.org>2015-12-11 15:19:37 +0100
commit549ec0b9393d12b6e82d230ed63ae1d9fe7af0ff (patch)
tree0f7e984559eaf5d34fd15e1acf2b74b8e8dbef23 /bin
parentea9a26a38bd9fe43177de9daa84c59e2430095df (diff)
downloadjenkins.debian.net-549ec0b9393d12b6e82d230ed63ae1d9fe7af0ff.tar.xz
reproducible: only do pbuilder maintenance if its used
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_maintenance.sh20
1 files 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