[CentOS] rsync question

Thu Sep 10 17:20:34 UTC 2015
Robert Moskowitz <rgm at htt-consult.com>


On 09/09/2015 08:17 PM, Carl E. Hartung wrote:
> On Wed, 9 Sep 2015 05:51:38 -0700 (PDT)
> Mark Milhollan wrote:
>
>> On Tue, 8 Sep 2015, Carl E. Hartung wrote:
>>> On Tue, 8 Sep 2015 10:25:33 -0700 (PDT) Mark Milhollan wrote:
>>>> -e specifies the *local* transport command to use
>>> What?! Straight from the documentation:
>>>
>>> "       -e, --rsh=COMMAND           specify the remote shell to use"
>> If only one can properly interpret the meaning...  COMMAND is the
>> local command to run to obtain a remote (non-interactive) shell, so
>> it isn't that the remote shell program (invoked once the transport is
>> connected) is being specified, i.e., it is which `remsh' to use.  The
>> -p and -l provided thereby may be necessary, since the one is not the
>> default and the other isn't known to us to be the same as the local
>> user, which you glossed over as if one never has a need to specify.
>>
>> Orthogonal to Robert's problem, the switch from default use of rsh to
>> ssh has made it a requirement for (good) automation to always supply
>> a -e to ensure the correct command is used to account for all
>> potential versions of rsync that may be used.
>>
>>>> , and in this case it also specifies the remote port (613) and user
>>>> (root).  Granted one should probably use their ssh configuration to
>>>> do that but it isn't realy "wrong" (to be questioned) to do it via
>>>> options.
>>> I didn't explicitly state that it was "wrong," just implied
>>> (correctly) that it was unnecessary.
>> Potentially unnecessary.  Just because you might see putting the port
>> and user in the ssh config file as the right thing to do, and which I
>> also do whenever possible, doesn't mean Robert necessarily wants to
>> or can do so, and after all -e does exist.  Your questioning its use
>> as you did implied using it is wrong, to which I object.  Luckily you
>> decided to reply to the list quoting me so eventually Robert was
>> supplied with the clue you didn't provide, that it might be
>> pre-configured.

I just tried the following:

rsync -ah --stats "ssh -p613 -l root" 192.168.192.2:/root/samba.PDC/ 
/home/rgm/data/htt/httnet/homebase/new/root/

And it failed with:

Unexpected remote arg: 192.168.192.2:/root/samba.PDC/
rsync error: syntax or usage error (code 1) at main.c(1330) [sender=3.1.1]

I tried again with:

rsync -ah --stats -e "ssh -p613 -l root" 192.168.192.2:/root/samba.PDC/ 
/home/rgm/data/htt/httnet/homebase/new/root/

and it worked.  This is what I read from the manpage, that "-e" is 
needed for the ssh command.