summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2013-09-18 21:13:12 +0000
committerAlan Conway <aconway@apache.org>2013-09-18 21:13:12 +0000
commita15d1810cedff3ff56d16725ecb8c4d04425c2db (patch)
treec2ba8f62d057d584ffa1f2e06399264047ba3ae7 /cpp
parent942a30ae5fe94268636e0313865e519e8fd87615 (diff)
downloadqpid-python-a15d1810cedff3ff56d16725ecb8c4d04425c2db.tar.gz
NO-JIRA: added -l USER option to rsynchosts script.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1524567 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rwxr-xr-xcpp/src/tests/rsynchosts12
1 files changed, 10 insertions, 2 deletions
diff --git a/cpp/src/tests/rsynchosts b/cpp/src/tests/rsynchosts
index 4f19c3b22a..81c9699ac3 100755
--- a/cpp/src/tests/rsynchosts
+++ b/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