From eb6bff2bf54151b6578ec76d38101d993d19b460 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Thu, 21 Jun 2012 17:36:03 +0200 Subject: [PATCH] fix rsync command --- live_build.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 -- 2.39.5