2000-10-13-17:54:11 Rylan W. Hazelton:
> I have searched high and low and cannot find any information about
> using rsync to do a Bi-Directional rsync.
> 
> Can it be done?  Can anyone help?

Depends on your usage pattern. I designed a system once where
records were being stored in a database with one file per record,
filename is the key, using hashing to schmear 'em out among
subdirectories nicely. What's more, external design constraints
allowed me to ignore the possibility of the same record being
updated within a short time on multiple different servers. I set up
symmetric distributed database replication, which I thought was just
stone cool; each server did periodic "rsync -u" pulls from each
other server, merging in any updates. I randomized the times they
happened and it was a genuine fire-n-forget, I loved that.

But if you can't make some fairly arcane guarantees about the files,
such that any given file only gets updated on one end or the other
between rsyncs, you've got an awfully hard problem to solve: it's
the "sync" problem popularized by PDAs, and various people have
worked on it, there's even some XML-based standard out there
somewhere to try and come up with a multi-application sync standard.

For an rsync-like tool, you might want to check out "unison"
<URL:http://www.cis.upenn.edu/~bcpierce/unison/>, in some sense it's
a companion project to rsync, and recently got the rsync
distributed-update algorithm added to it.

Unison does some things that rsync doesn't. If you were to lock your
system clocks reliably in perfect sync, if no program ever dorked
with a file's timestamp, and if you never ever modified the same
file on both ends between syncs, then an "rsync -u" in each
direction would (I believe) do the same thing. But unison doesn't
require those guarantees, and it raises an alarm if a file is
modified on both ends. Or at least so the documentation claims, I've
not actually used it (I only download sources, and haven't gotten
excited enough about Unison to bootstrap myself an Objective CAML
development environment:-).

-Bennett

PGP signature

Reply via email to