Mess with rsync options
authorPeter Palfrader <peter@palfrader.org>
Sat, 8 Dec 2012 17:56:09 +0000 (18:56 +0100)
committerPeter Palfrader <peter@palfrader.org>
Sat, 8 Dec 2012 17:56:09 +0000 (18:56 +0100)
modules/roles/files/static-mirroring/static-master-ssh-wrap
modules/roles/files/static-mirroring/static-master-update-component
modules/roles/files/static-mirroring/static-mirror-run
modules/roles/files/static-mirroring/static-mirror-ssh-wrap

index df7e721..b5c88be 100755 (executable)
@@ -89,9 +89,9 @@ serve_dir() {
 do_rsync() {
        local remote_host="$1"; shift
 
-       if [ "$*" = "--server --sender -vlogDtprze.iLsf . -new-/" ] ; then
+       if [ "$*" = "--server --sender -vltrze.iLsf --safe-links . -new-/" ] ; then
                serve_dir "$remote_host" "$BASEDIR/current-push"
-       elif [ "$*" = "--server --sender -vlogDtprze.iLsf . -live-/" ] ; then
+       elif [ "$*" = "--server --sender -vltrze.iLsf --safe-links . -live-/" ] ; then
                local p="$BASEDIR/current-live"
                info "host $remote_host wants $p, acquiring lock"
                lock 200 "$p" 0
index 197044f..af8a5f7 100755 (executable)
@@ -109,7 +109,8 @@ echo "$0: Got them."
 
 echo "$0: Updating master copy of $component..."
 rsync --delete \
-  -tr \
+  -trz \
+  --links --safe-links \
   --link-dest="$tgt" \
   "$src/." "$tmpdir_new/."
 echo "$0: Done.  Committing."
index bdcc928..b2bc078 100755 (executable)
@@ -64,7 +64,7 @@ if [ -z "$BASEDIR" ]; then usage >&2; exit 1; fi
 if [ -z "$SYNC_SOURCE" ]; then usage >&2; exit 1; fi
 
 RSYNC="rsync"
-RSYNC_BASE_OPTIONS="-avz --delete"
+RSYNC_BASE_OPTIONS="-rtvz --delete --links --safe-links"
 RSYNC_SSH_OPTIONS="ssh -o AddressFamily=inet -o BatchMode=yes"
 
 LOGDIR="$HOME/logs"
index b199ce9..9114879 100755 (executable)
@@ -76,7 +76,7 @@ do_rsync() {
 
        if [ -e "$COMPONENTLIST" ]; then
                for path in $(awk -v host="$(hostname -f)" '$2 == host {print $3}' $COMPONENTLIST); do
-                       allowed_rsyncs+=("--server --sender -tre.iLsf . $path/.")
+                       allowed_rsyncs+=("--server --sender -ltrze.iLsf --safe-links . $path/.")
                done
        fi
        for cmd_idx in ${!allowed_rsyncs[*]}; do