]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
fix rsync command
authorHolger Levsen <holger@layer-acht.org>
Thu, 21 Jun 2012 15:36:03 +0000 (17:36 +0200)
committerHolger Levsen <holger@layer-acht.org>
Thu, 21 Jun 2012 15:36:03 +0000 (17:36 +0200)
live_build.sh

index d6bb3937699f333a1b0a56a5b00804957d75c469..c32a1ec546b738c2bb06b03653f48fc63661397e 100755 (executable)
@@ -31,21 +31,22 @@ cp -v tftpboot/debian-live/amd64/initrd.img-3* tftpboot/debian-live/amd64/vmlinu
 cp -v binary/live/filesystem.squashfs $BUILD_TARGET/
 
 echo "Now rsyncing results to mgmt1..."
-rsync --password-file /etc/rsynclivebuild-send.pass -avv --delete /srv/mirror/live-build/ rsync://livebuild@10.1.1.1/livebuild/*
+rsync --password-file /etc/rsynclivebuild-send.pass -avv --delete /srv/mirror/live-build/ rsync://livebuild@10.1.1.1/livebuild/
 
 figlet "rsync success"
 
 #
-# cleanup /srv/mirror, keep max number of images
+# cleanup /srv/mirror, keep MAX number of images
 # 
+MAX=10
 cd /srv/mirror/live-build/
 COUNT=0
 for i in $(ls -artd1 ./${LIVE_TYPE}-*) ; do
        let COUNT=COUNT+1
-       if [ $COUNT -gt 2 ] ; then
-               echo "would rm -rf $i" 
+       if [ $COUNT -gt $MAX ] ; then
+               rm -rfv $i
        else
-               echo "would keep $i"
+               echo "keeping $i"
        fi
 done