From 8ab2d44a1f18f1d17a04e4937f13d1fb7c47a58b Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 2 May 2015 12:16:09 +0200 Subject: [PATCH] Add -x to allowed rsync parameteres due to jessie --- .../static-mirroring/staticsync-ssh-wrap | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/modules/roles/files/static-mirroring/staticsync-ssh-wrap b/modules/roles/files/static-mirroring/staticsync-ssh-wrap index 300f5436..ba880881 100755 --- a/modules/roles/files/static-mirroring/staticsync-ssh-wrap +++ b/modules/roles/files/static-mirroring/staticsync-ssh-wrap @@ -74,25 +74,31 @@ do_mirror() { do_rsync_on_master() { local remote_host="$1"; shift - local args="--server --sender -vlHtrze.iLsf --safe-links ." + local allowed_rsyncs + allowed_rsyncs=() + allowed_rsyncs+=("--server --sender -vlHtrze.iLsf --safe-links .") # wheezy + allowed_rsyncs+=("--server --sender -vlHtrze.iLsfx --safe-links .") # jessie - for component in $(awk -v this_host="$(hostname -f)" '!/^ *(#|$)/ && $1 == this_host {print $2}' $COMPONENTLIST); do - if [ "$*" = "$args $component/-new-/" ] || [ "$*" = "$args ./$component/-new-/" ] ; then - local path="$BASEDIR/master/$component-current-push" - info "serving $remote_host with $path" - exec rsync $args "$path/." - croak "Exec failed" - elif [ "$*" = "$args $component/-live-/" ] || [ "$*" = "$args ./$component/-live-/" ] ; then - local path="$BASEDIR/master/$component-current-live" - info "host $remote_host wants $path, acquiring lock" - exec 200< "$path" - if ! flock -s -w 0 200; then - echo >&2 "Cannot acquire shared lock on $path - this should mean an update is already underway anyway." - exit 1 + for cmd_idx in ${!allowed_rsyncs[*]}; do + args="${allowed_rsyncs[$cmd_idx]}" + for component in $(awk -v this_host="$(hostname -f)" '!/^ *(#|$)/ && $1 == this_host {print $2}' $COMPONENTLIST); do + if [ "$*" = "$args $component/-new-/" ] || [ "$*" = "$args ./$component/-new-/" ] ; then + local path="$BASEDIR/master/$component-current-push" + info "serving $remote_host with $path" + exec rsync $args "$path/." + croak "Exec failed" + elif [ "$*" = "$args $component/-live-/" ] || [ "$*" = "$args ./$component/-live-/" ] ; then + local path="$BASEDIR/master/$component-current-live" + info "host $remote_host wants $path, acquiring lock" + exec 200< "$path" + if ! flock -s -w 0 200; then + echo >&2 "Cannot acquire shared lock on $path - this should mean an update is already underway anyway." + exit 1 + fi + exec rsync $args "$path/." + croak "Exec failed" fi - exec rsync $args "$path/." - croak "Exec failed" - fi + done done } -- 2.39.2