Re: Instructions on how rsync uses ssh to run remotely?

2001-07-10 Thread Dave Dykstra

On Tue, Jul 10, 2001 at 02:24:57AM -0700, Ben Escoto wrote:
 
 About two weeks ago I asked about a way to use rsync to backup (I
 wanted to make something in-between a mirror and an incremental
 backup).  I wrote a preliminary version of a program that does this
 (see http://www.stanford.edu/~bescoto/rdiff-backup), and am now
 considering adding remote filesystem support through ssh the way rsync
 does.
 
 Conceptually this may not be too hard, but there are probably
 issues that will arise that I don't foresee now.  So if anyone knows
 of a description of how rsync does the ssh/rsh client/server bit, or
 maybe something more generic on how to use ssh in the way rsync does,
 I would appreciate a reference.  I could look at the rsync source, but
 it doesn't seem to be overly commented, and I'm not exactly fluent in
 C and thought that this post might save me time in any event.  Thanks.


All that rsync uses ssh for is to open a bi-directional data pipe and run a
command (another rsync program) on the remote side.  It then ignores ssh
(or rsh, the default) and does its own protocol over the pipe between the
two sides.

- Dave Dykstra




Re: Instructions on how rsync uses ssh to run remotely?

2001-07-10 Thread Ben Escoto

 DD == Dave Dykstra [EMAIL PROTECTED]
 wrote the following on Tue, 10 Jul 2001 10:34:53 -0500

  DD All that rsync uses ssh for is to open a bi-directional data
  DD pipe and run a command (another rsync program) on the remote
  DD side.  It then ignores ssh (or rsh, the default) and does its
  DD own protocol over the pipe between the two sides.

Hmm, doesn't rsync run two copies of itself on the remote side?  Maybe
it uses three (?) unidirectional pipes instead of one bi-directional
one?  And either way, it would be nice to have a primer on designing a
protocol like this, since I'm sure many people have already figured
out the best way to handle latency, errors, etc.


--
Ben Escoto




Re: Instructions on how rsync uses ssh to run remotely?

2001-07-10 Thread Dave Dykstra

On Tue, Jul 10, 2001 at 10:58:21AM -0700, Ben Escoto wrote:
  DD == Dave Dykstra [EMAIL PROTECTED]
  wrote the following on Tue, 10 Jul 2001 10:34:53 -0500
 
   DD All that rsync uses ssh for is to open a bi-directional data
   DD pipe and run a command (another rsync program) on the remote
   DD side.  It then ignores ssh (or rsh, the default) and does its
   DD own protocol over the pipe between the two sides.
 
 Hmm, doesn't rsync run two copies of itself on the remote side?  Maybe
 it uses three (?) unidirectional pipes instead of one bi-directional
 one?  And either way, it would be nice to have a primer on designing a
 protocol like this, since I'm sure many people have already figured
 out the best way to handle latency, errors, etc.


rsync forks itself into two copies on the receiver side, one process
for generating checksums and one for receiving updates.  It's still a
single bi-directional pipe, it's just that on the receiver side one process
is writing and one is mainly reading.

I've never read it myself, but I imagine that Andrew Tridgell's PhD thesis
covers the protocol design.  I don't think it's written down anywhere else.
You can find it on his home page, http://samba.org/~tridge.

- Dave Dykstra