From 96ce46531ca88c067363556cd84347a813e1dc37 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 5 Oct 2015 11:36:47 +0200 Subject: reproducible: dont fail on vanishing cruft --- bin/reproducible_maintenance.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bin/reproducible_maintenance.sh') diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh index fbc8eaa7..a8ef120d 100755 --- a/bin/reproducible_maintenance.sh +++ b/bin/reproducible_maintenance.sh @@ -102,11 +102,11 @@ set -e # delete old temp directories echo "$(date -u) - Deleting old temp directories." -OLDSTUFF=$(find $REP_RESULTS -maxdepth 1 -type d -name "tmp.*" -mtime +2 -exec ls -lad {} \;) +OLDSTUFF=$(find $REP_RESULTS -maxdepth 1 -type d -name "tmp.*" -mtime +2 -exec ls -lad {} \; || true) if [ ! -z "$OLDSTUFF" ] ; then echo echo "Old temp directories found in $REP_RESULTS" - find $REP_RESULTS -maxdepth 1 -type d -name "tmp.*" -mtime +2 -exec rm -rv {} \; + find $REP_RESULTS -maxdepth 1 -type d -name "tmp.*" -mtime +2 -exec rm -rv {} \; || true echo "These old directories have been deleted." echo DIRTY=true @@ -123,13 +123,13 @@ ps fax|grep -v grep |grep "schroot --directory" || for i in $(schroot --all-sess # find old schroots echo "$(date -u) - Removing old schroots." -OLDSTUFF=$(find /schroots/ -maxdepth 1 -type d -regextype posix-extended -regex "/schroots/reproducible-.*-[0-9]{1,5}" -mtime +2 -exec ls -lad {} \;) +OLDSTUFF=$(find /schroots/ -maxdepth 1 -type d -regextype posix-extended -regex "/schroots/reproducible-.*-[0-9]{1,5}" -mtime +2 -exec ls -lad {} \; || true) if [ ! -z "$OLDSTUFF" ] ; then echo echo "Old schroots found in /schroots, which will be deleted:" - find /schroots/ -maxdepth 1 -type d -regextype posix-extended -regex "/schroots/reproducible-.*-[0-9]{1,5}" -mtime +2 -exec sudo rm -rf --one-file-system {} \; + find /schroots/ -maxdepth 1 -type d -regextype posix-extended -regex "/schroots/reproducible-.*-[0-9]{1,5}" -mtime +2 -exec sudo rm -rf --one-file-system {} \; || true echo "$OLDSTUFF" - OLDSTUFF=$(find /schroots/ -maxdepth 1 -type d -regextype posix-extended -regex "/schroots/reproducible-.*-[0-9]{1,5}" -mtime +2 -exec ls -lad {} \;) + OLDSTUFF=$(find /schroots/ -maxdepth 1 -type d -regextype posix-extended -regex "/schroots/reproducible-.*-[0-9]{1,5}" -mtime +2 -exec ls -lad {} \; || true) if [ ! -z "$OLDSTUFF" ] ; then echo echo "Warning: Tried, but failed to delete these:" -- cgit v1.2.3-70-g09d2