]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
dont delete the new tar archives..
authorHolger Levsen <holger@layer-acht.org>
Tue, 9 Apr 2013 15:53:43 +0000 (17:53 +0200)
committerHolger Levsen <holger@layer-acht.org>
Tue, 9 Apr 2013 15:53:43 +0000 (17:53 +0200)
extract_storage_kernel+modules.sh

index dd5aa6dbc8fb4aefcdbdf8fe028eecce3c32464c..885f4faf68558151dc468d16bb1444e43b705ea4 100755 (executable)
@@ -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