aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-08-17 12:31:29 -0300
committerSilvio Rhatto <rhatto@riseup.net>2010-08-17 12:31:29 -0300
commitaac802e29c51dbe81f0f3a977c2020777051a968 (patch)
treeed763c96f95123fb10882e98d6a1eccf46c39465
parent03b6ba6e7384943d30fe07f3d7fe94d47bdf012d (diff)
downloadpuppet-backup-aac802e29c51dbe81f0f3a977c2020777051a968.tar.gz
puppet-backup-aac802e29c51dbe81f0f3a977c2020777051a968.tar.bz2
RSYNC_RSH fix
-rw-r--r--files/handlers/rsync11
1 files changed, 6 insertions, 5 deletions
diff --git a/files/handlers/rsync b/files/handlers/rsync
index 44f9e7f..9f4590e 100644
--- a/files/handlers/rsync
+++ b/files/handlers/rsync
@@ -279,7 +279,8 @@ function eval_config {
nice=""
fi
- ssh_cmd="ssh -T -o PasswordAuthentication=no -o Hostname=$host -p $port -l $user -i $id_file"
+ ssh_cmd_base="ssh -T -o PasswordAuthentication=no -o Hostname=$host -p $port -l $user -i $id_file"
+ ssh_cmd="$ssh_cmd_base $user@$host"
if [ "$from" == "remote" ] || [ "$dest" == "remote" ]; then
if [ "$testconnect" == "yes" ] && [ "$protocol" == "ssh" ]; then
@@ -911,9 +912,9 @@ function set_rsync_options {
fatal "SSH Identity file $id_file not found"
exit 1
else
- debug RSYNC_RSH=\"$ssh_cmd\"
- echo RSYNC_RSH=\"$ssh_cmd\" >> $log
- export RSYNC_RSH="$ssh_cmd"
+ debug RSYNC_RSH=\"$ssh_cmd_base\"
+ echo RSYNC_RSH=\"$ssh_cmd_base\" >> $log
+ export RSYNC_RSH="$ssh_cmd_base"
fi
fi
@@ -1062,7 +1063,7 @@ for SECTION in $include; do
info "Syncing $SECTION on $dest_path..."
debug $nice $rsync "${rsync_options[@]}" $filelist_flag $excludes $batch_option $orig $dest_path
- $nice $rsync "${rsync_options[@]}" $filelist_flag $excludes $batch_option $orig $dest_path >> $log
+ $nice $rsync "${rsync_options[@]}" $filelist_flag $excludes $batch_option $orig $dest_path | tee -a $log
if [ "$?" != "0" ]; then
warning "Rsync error when trying to transfer $SECTION"