rsync command for multi files and dirs from remote server

Benjamin R. Haskell rsync at benizi.com
Sun Sep 18 21:06:33 MDT 2011


On Sun, 18 Sep 2011, Noah wrote:

> Hi there,
>
> okay so I have a port knocker installed on my remote server so I am 
> trying to bundle a bunch of directories in a single ssh session that 
> rsync establishes.  so far all the rsync examples I have seen require 
> a new ssh session for each directory.
>
> is there anyway to get something like this into one line and therefore 
> one ssh session.  Clues on this?

Try the ControlMaster=auto option to SSH with an appropriate ControlPath 
setting.

Example of usage at: (Googled: SSH multiplex)
http://www.linuxjournal.com/content/speed-multiple-ssh-connections-same-server

As an '-e' argument, it'd be:

-e 'ssh [...etc...] -o ControlMaster=auto -o ControlPath=~/.ssh/master-%r@%h:%p [...etc...]'

-- 
Best,
Ben


More information about the rsync mailing list