From 312ad2929debb23b0e5e93534bb90621bff234dc Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 8 Dec 2012 18:56:09 +0100 Subject: [PATCH] Mess with rsync options --- modules/roles/files/static-mirroring/static-master-ssh-wrap | 4 ++-- .../files/static-mirroring/static-master-update-component | 3 ++- modules/roles/files/static-mirroring/static-mirror-run | 2 +- modules/roles/files/static-mirroring/static-mirror-ssh-wrap | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/roles/files/static-mirroring/static-master-ssh-wrap b/modules/roles/files/static-mirroring/static-master-ssh-wrap index df7e7217..b5c88be7 100755 --- a/modules/roles/files/static-mirroring/static-master-ssh-wrap +++ b/modules/roles/files/static-mirroring/static-master-ssh-wrap @@ -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 diff --git a/modules/roles/files/static-mirroring/static-master-update-component b/modules/roles/files/static-mirroring/static-master-update-component index 197044f7..af8a5f7e 100755 --- a/modules/roles/files/static-mirroring/static-master-update-component +++ b/modules/roles/files/static-mirroring/static-master-update-component @@ -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." diff --git a/modules/roles/files/static-mirroring/static-mirror-run b/modules/roles/files/static-mirroring/static-mirror-run index bdcc9283..b2bc078e 100755 --- a/modules/roles/files/static-mirroring/static-mirror-run +++ b/modules/roles/files/static-mirroring/static-mirror-run @@ -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" diff --git a/modules/roles/files/static-mirroring/static-mirror-ssh-wrap b/modules/roles/files/static-mirroring/static-mirror-ssh-wrap index b199ce98..91148790 100755 --- a/modules/roles/files/static-mirroring/static-mirror-ssh-wrap +++ b/modules/roles/files/static-mirroring/static-mirror-ssh-wrap @@ -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 -- 2.39.2