diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2010-08-17 12:18:16 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2010-08-17 12:18:16 -0300 |
commit | 9fe6ebf3777e4c03d79d824def69ac7b67783c03 (patch) | |
tree | 3d52c13dd161b177813eafc57a6079cd63c364ce /handlers/rsync.in | |
parent | 7ef6a0b844d26e75188ea3609f79b3affafc9083 (diff) | |
download | backupninja-9fe6ebf3777e4c03d79d824def69ac7b67783c03.tar.gz backupninja-9fe6ebf3777e4c03d79d824def69ac7b67783c03.tar.bz2 |
RSYNC_RSH fix
Diffstat (limited to 'handlers/rsync.in')
-rw-r--r-- | handlers/rsync.in | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/handlers/rsync.in b/handlers/rsync.in index be97773..21e4ab2 100644 --- a/handlers/rsync.in +++ b/handlers/rsync.in @@ -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" |