From: Holger Levsen Date: Wed, 17 Oct 2012 09:15:41 +0000 (+0200) Subject: fixup: implement proper garbage collection, delete results if jenkins logs are deleted X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=325b3cb729482acd726effec7c05e0a2d6b7107a;p=profitbricks%2Fjenkins-build-scripts.git fixup: implement proper garbage collection, delete results if jenkins logs are deleted --- diff --git a/extract_storage_kernel+modules.sh b/extract_storage_kernel+modules.sh index 307c4c5..47b653e 100755 --- a/extract_storage_kernel+modules.sh +++ b/extract_storage_kernel+modules.sh @@ -57,10 +57,11 @@ echo "Garbage collection in debug mode..." # cd $TARGET_BASE/$TARGET_NAME # loop through all results of current target -for i in $(ls -atd1) ; do +for i in $(ls -at1) ; do echo $i - # check if the jenkins build log still exists, if not, delete the old target as well - if [ "$i" != "." ] && [ ! -L $JOB_HOME/$i ] ; then + # check if the jenkins build log still exists (and doesnt start with ".") + # and if not, delete the old target as well + if [ ! -L $JOB_HOME/$i ] && [ "$i:0:1" != "." ] ; then echo sudo rm -rfv ./$i else echo "keeping $i"