From 75752039947f9b4ce5ac51ab6f4111c16a21ddd5 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sun, 4 Dec 2016 09:28:21 +0100 Subject: d-i maintenance: ignore /srv/d-i/isos when looking for old stuff Signed-off-by: Holger Levsen --- bin/maintenance.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/maintenance.sh b/bin/maintenance.sh index bb75c5dc..41c166b5 100755 --- a/bin/maintenance.sh +++ b/bin/maintenance.sh @@ -62,9 +62,12 @@ report_old_directories() { # find and warn about old temp directories if [ -z "$3" ] ; then OLDSTUFF=$(find $1/* -maxdepth 0 -type d -mtime +$2 -exec ls -lad {} \;) - else + elif [ -z "$4" ] ; then # if $3 is given, ignore it OLDSTUFF=$(find $1/* -maxdepth 0 -type d -mtime +$2 ! -path "$3*" -exec ls -lad {} \;) + else + # if $3 + $4 are given, ignore them + OLDSTUFF=$(find $1/* -maxdepth 0 -type d -mtime +$2 ! -path "$3*" ! -path "$4*" -exec ls -lad {} \;) fi if [ ! -z "$OLDSTUFF" ] ; then echo "Warning: old temp directories found in $1" @@ -193,7 +196,7 @@ else echo "WARNING: there is no check / handling on stale lvm volumes" rm $ACTIVE_JOBS $WATCHED_JOBS $RUNNING ;; - d-i) report_old_directories /srv/d-i 7 /srv/d-i/workspace + d-i) report_old_directories /srv/d-i 7 /srv/d-i/workspace /srv/d-i/isos ;; squid) report_squid_usage ;; -- cgit v1.2.3-70-g09d2