From: Holger Levsen Date: Thu, 21 Jun 2012 15:36:03 +0000 (+0200) Subject: fix rsync command X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=eb6bff2bf54151b6578ec76d38101d993d19b460;p=profitbricks%2Fjenkins-build-scripts.git fix rsync command --- diff --git a/live_build.sh b/live_build.sh index d6bb393..c32a1ec 100755 --- a/live_build.sh +++ b/live_build.sh @@ -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