From c6bd6413ad16a375560472f31c864c812e4ab4da Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Sun, 27 Sep 2009 00:13:25 +0200 Subject: [PATCH] reworked update.sh script --- root/farm.txt | 5 +++++ update.sh | 30 ++++++++---------------------- 2 files changed, 13 insertions(+), 22 deletions(-) create mode 100644 root/farm.txt diff --git a/root/farm.txt b/root/farm.txt new file mode 100644 index 0000000..f72da34 --- /dev/null +++ b/root/farm.txt @@ -0,0 +1,5 @@ +root@yoda.easy-cloud.net 2203 /etc/opt/djbdns/tinydns/root +root@yoda2.easy-cloud.net 2201 /etc/opt/djbdns/tinydns/root +root@darthbane.easy-cloud.net 2201 /etc/opt/djbdns/tinydns/root +root@atlien.easy-cloud.net 22 /etc/opt/djbdns/tinydns/root +root@koke.easy-cloud.net 2203 /etc/opt/djbdns/tinydns/root diff --git a/update.sh b/update.sh index b60cae9..5db5678 100755 --- a/update.sh +++ b/update.sh @@ -1,31 +1,17 @@ #!/bin/sh -DIRS= -for x in root/*/Makefile; do - DIRS="$DIRS ${x%/*}" - make -C ${x%/*} -done - -RSYNCOPT="$RSYNCOPT --exclude */*.zone.in" -RSYNCOPT="$RSYNCOPT --exclude .gitignore" -RSYNCOPT="$RSYNCOPT --exclude Makefile" +RSYNCOPT="-azOP" +#RSYNCOPT="$RSYNCOPT --exclude */*.zone.in" +#RSYNCOPT="$RSYNCOPT --exclude .gitignore" +RSYNCOPT="$RSYNCOPT --exclude data.cdb" #RSYNCOPT="$RSYNCOPT --dry-run" -RSYNCOPT="$RSYNCOPT --delete --delete-after --delete-excluded" +RSYNCOPT="$RSYNCOPT --delete --delete-after" -( -cat <<-EOT -root@yoda.easy-cloud.net 2203 /etc/opt/djbdns/tinydns/root -root@yoda2.easy-cloud.net 2201 /etc/opt/djbdns/tinydns/root -root@darthbane.easy-cloud.net 2201 /etc/opt/djbdns/tinydns/root -root@atlien.easy-cloud.net 22 /etc/opt/djbdns/tinydns/root -root@koke.easy-cloud.net 2203 /etc/opt/djbdns/tinydns/root -EOT -) | while read REMOTE PORT DIR; do +while read REMOTE PORT DIR; do ( export RSYNC_RSH="ssh -p $PORT" echo "=== $REMOTE:$PORT ($DIR) ===" - rsync -a root/Makefile "$REMOTE:$DIR/" - rsync -a $RSYNCOPT $DIRS "$REMOTE:$DIR/" + rsync $RSYNCOPT data/stage/ "$REMOTE:$DIR/" && ssh -p $PORT $REMOTE make -B -C "$DIR/" data.cdb ) < /dev/null -done +done < root/farm.txt