]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
fixup: implement proper garbage collection, delete results if jenkins logs are deleted
authorHolger Levsen <holger@layer-acht.org>
Wed, 17 Oct 2012 09:15:41 +0000 (11:15 +0200)
committerHolger Levsen <holger@layer-acht.org>
Wed, 17 Oct 2012 09:15:41 +0000 (11:15 +0200)
extract_storage_kernel+modules.sh

index 307c4c5c0cf7247811002052eb9ca93285c8be56..47b653ead6920e085e0a2c3515d2f24f7cc5cc98 100755 (executable)
@@ -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"