From: Holger Levsen Date: Tue, 9 Apr 2013 15:53:43 +0000 (+0200) Subject: dont delete the new tar archives.. X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=a9034ef7ac0375d8334e1ee27864f5c5034a6d24;p=profitbricks%2Fjenkins-build-scripts.git dont delete the new tar archives.. --- diff --git a/extract_storage_kernel+modules.sh b/extract_storage_kernel+modules.sh index dd5aa6d..885f4fa 100755 --- a/extract_storage_kernel+modules.sh +++ b/extract_storage_kernel+modules.sh @@ -69,10 +69,10 @@ echo "Doing garbage collection now" # cd $TARGET_BASE/$TARGET_NAME # loop through all results of current target -for i in $(ls -at1) ; do - # check if the jenkins build log still exists (and doesnt start with ".") +for i in $(find . -maxdepth 1 -type d|sort) ; do + # check if the jenkins build log still exists (and $i != ".") # and if not, delete the old target as well - if [ ! -L $JOB_HOME/$i ] && [ "${i:0:1}" != "." ] ; then + if [ ! -L $JOB_HOME/$i ] && [ "${i}" != "." ] ; then echo "Deleting $TARGET_BASE/$TARGET_NAME/$i" sudo rm -r ./$i fi