reconnect ssh connection?

jw schultz jw at
Wed Jan 29 01:26:06 EST 2003

On Tue, Jan 28, 2003 at 06:41:20AM -0700, David Garamond wrote:
> has someone come up with a trick to let disconnected ssh connections be 
> recovered without terminating and having to restart rsync (perhaps by 
> wrapping ssh or something)?
> i have a very large (but pretty stable/unchanging) tree of files that i 
> need to sync daily, at night, between two geographically different 
> servers. i'm using rsync -avz --force -e ssh SOURCE DEST. the connection 
> is pretty slow and quite unreliable and many times the rsync process is 
> terminated in the middle because of disconnected tcp connection. 
> restarting rsync would begin the process of building the filelist which 
> is pretty slow.

Not really doable.  When the connection is lost the remote
process dies.  Even rsyncd couldn't sensibly support a
reconnect.  There is just too much context to restart the
remote end without restarting the local as well.

What i'd look into doing in your case would be to break the
tree up into smaller jobs that would run quicker and be less
likely to be fail.  Wrap each sub-job in a loop that repeats
on failure.

The --from-files option (patch form only for now) could have
some possibilities here but you'd still need to identify
deleted files.

	J.W. Schultz            Pegasystems Technologies
	email address:		jw at

		Remember Cernan and Schmitt

More information about the rsync mailing list