diff options
| author | Alan Conway <aconway@apache.org> | 2013-09-18 21:13:12 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2013-09-18 21:13:12 +0000 |
| commit | de0c2b63bb38d156bb4967b71440e478653d2c0e (patch) | |
| tree | 94a3e007059bcd0efe49b1b4b6b4afb13fa02f95 /qpid/cpp/src/tests | |
| parent | 40e9c0c1512f74e2e78448f4a3aa2bc0a9271927 (diff) | |
| download | qpid-python-de0c2b63bb38d156bb4967b71440e478653d2c0e.tar.gz | |
NO-JIRA: added -l USER option to rsynchosts script.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1524567 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests')
| -rwxr-xr-x | qpid/cpp/src/tests/rsynchosts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/qpid/cpp/src/tests/rsynchosts b/qpid/cpp/src/tests/rsynchosts index 4f19c3b22a..81c9699ac3 100755 --- a/qpid/cpp/src/tests/rsynchosts +++ b/qpid/cpp/src/tests/rsynchosts @@ -27,13 +27,21 @@ abspath() { } usage() { - echo "Usage: $(basename $0) file [file...] + echo "Usage: $(basename $0) [-l user] file [file...] Synchronize the contents of each file or directory to the same absolute path on each host in \$HOSTS. " exit 1 } +while getopts "l:" opt; do + case $opt in + l) RSYNC_USER="$OPTARG@" ;; + *) usage ;; + esac +done +shift `expr $OPTIND - 1` + test "$*" || usage for f in $*; do FILES="$FILES $(abspath $f)" || exit 1; done @@ -42,7 +50,7 @@ OK_FILE=`mktemp` # Will be deleted if anything goes wrong. trap "rm -f $OK_FILE" EXIT for h in $HOSTS; do - rsync -aRO --delete $FILES $h:/ || { echo "rsync to $h failed"; rm -f $OK_FILE; } & + rsync -vaRO --delete $FILES $RSYNC_USER$h:/ || { echo "rsync to $h failed"; rm -f $OK_FILE; } & done wait test -f $OK_FILE |
