"-signs in rsync as well as in embedded ssh command

Matt McCutchen hashproduct at verizon.net
Fri Oct 21 13:21:04 GMT 2005


On Fri, 2005-10-21 at 14:56 +0200, Peter van der Meer wrote:
> Today I succesfully transfered some testfile on my local computer with the
> following command:
>  rsync -e "ssh" testfile.txt localhost:receive
> 
> I can also succesfully connect with SSH to a remote server through an http proxy
> with the following command:
>  ssh -o "ProxyCommand corkscrew myhttpProxy 8080 targetcomputer.domain 22"
> targetcomputer.domain
> 
> But I'm so far unable to combine them, mostly because the "-signs in the SSH
> command seem to conflict with the "-signs in the rsync command.

The trouble is that rsync parses the "-e" command into arguments, and it
just splits at every whitespace character without regard for the inner
quotes.  Maybe rsync should really be calling on a shell to parse the
command.

I can think of two ways to work around this:

(1) Put the ProxyCommand option in your ~/.ssh/config so that SSH will
use it automatically whenever you connect to targetcomputer.domain .

(2) If you don't want that, write a shell script like this:
                #!/bin/bash
                ssh -o "ProxyCommand corkscrew myhttpProxy 8080 targetcomputer.domain 22" "$@"
and supply the name of this shell script as the "-e" command.

-- 
Matt McCutchen, ``hashproduct''
hashproduct at verizon.net -- http://mysite.verizon.net/hashproduct/



More information about the rsync mailing list