File merging

Britton fsblk at aurora.uaf.edu
Fri Sep 14 13:55:13 EST 2001


On Thu, 13 Sep 2001, Andy Goth wrote:

> On Thursday, September 13, 2001 10:28, you wrote:
> > On Thu, 13 Sep 2001, Andy Goth wrote:
> > > Can rsync be made to merge files?  For instance, could I synchronize
> > > mboxes between multiple computers, even though they're all changing?
> >
> > Not if they are changing simultaneously.  You can't do that at all,
> > without a distributed filesystem with locking.
>
> I'll avoid simultaneous changes, then, by remembering (or automating) updates
> before switching computers.  I could probably do this pretty easily as some
> sort of an eth0-up script.

This is the way to do it.  Its easy to forget though, so if you are a
regular person and can possibly do it from cron you can save some pain.
Even with, I'd advise the use of dry run. However, at the moment, dry run
seems to not report new empty directories, I hope to contribute a patch to
fis this soon (looks straitforward).  It transfers them fine, but it can
make you nervous.

> > On the other hand, if only one system changes at a time rsync works fine.
>
> Okay, then, can rsync identify the newer version and copy it to the other
> system?

I've never investigated this carefully enough to be sure.  If you delete
files at one end, they will definately go away at the other, assuming you
use --delete, which you presumably want.  If you only change files at both
ends (and the same files are not changed at both ends), and then forget to
sync, rsync will note the timestamps and not stomp the new changes, no
matter which way you sync, I think.

Britton

> --
> Andy Goth  |  unununium at openverse.org  |  http://null.cc.uic.edu/~andy/





More information about the rsync mailing list