From 374bce8b07b84baf858463ee21e1569dde15734b Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Thu, 30 Apr 2015 19:31:58 +0200 Subject: reproducible: maintenance: fix find call to be more clever about what to delete (avoid deleting debbindiff schroot) --- bin/reproducible_maintenance.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh index 098e63db..2f7fed83 100755 --- a/bin/reproducible_maintenance.sh +++ b/bin/reproducible_maintenance.sh @@ -48,11 +48,11 @@ if [ ! -z "$OLDSTUFF" ] ; then fi # find old schroots -OLDSTUFF=$(find /schroots/ -maxdepth 1 -type d -name "reproducible-*-*" -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 {} \;) if [ ! -z "$OLDSTUFF" ] ; then echo echo "Warning: old schroots found in /schroots, which have been deleted:" - find /schroots/ -maxdepth 1 -type d -name "reproducible-*-*" -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 {} \; echo "$OLDSTUFF" echo DIRTY=true -- cgit v1.2.3-54-g00ecf