Possible Duplicate:
Using an already established SSH channel
I have a remote server accessible via a chain of SSH proxies. The resulting channel is wide and fast enough, but setting it up takes a couple seconds.
I want to periodically run rsync
against this server, synchronizing small changes to a relatively large file tree.
When I do it plainly by rsync -r source_dir remote_host:target_dir
, most of the time is spent establishing the connection. For comparison, establishing an interactive connection to that host takes about the same time.
Is there a way to somehow reuse the SSH connection across several rsync
invocations, to avoid the connection delay?
The catch is that I don't want continuous replication of files to the remote host; file tree has to be consistent at the moment of the replication, so I'd like to trigger the rsync event myself.
I'm open to using something else, e.g. git
, as long as I avoid the constant reconnection delay and don't have to open a listening port on the remote host.