"symmetric" mirroring (was "testing")

Rich Winkel rich at math.missouri.edu
Thu Apr 25 20:35:01 EST 2002


Hi Martin,

I guess I need to be more specific.  I have a unix user who has unix
machines at home and at work.  He wants local access to the same set of
files whether he's at home or at work.

> If each side updates a non-overlapping set of files you can do this
> using --update to push only the newer file to each side.

That much I figured out, but a problem arises when files are created
or deleted.  If a file on A has no counterpart on B, should it be
deleted or copied over to B?  My primitive idea is just to compare
the date stamp (or inode modification time) of the file with the
time of the last rsync, and either copy it over if it's newer, or
delete it.  Not very pretty, I know, but it would suffice for his
purposes, and it would be easy to implement with an option like
--symmetric=date_stamp_file
where date_stamp_file is "touched" every time rsync runs.
Ideally this would cause rsync to run in a "duplex" mode where
files could be copied in either direction depending on which is
newer.  But that part sounds like a pretty major project.

> If single files are updated on both sides you need a content-dependent
> way of merging them, which is out of the scope of rsync.  Have a look
> at the Unison tool.

Thanks for the tip, it sounds interesting.  I'll check it out!

Rich





More information about the rsync mailing list