Filesystem wars! (was Re: woody CDs :()

Kevin Buettner plug-discuss@lists.plug.phoenix.az.us
Wed, 27 Mar 2002 16:02:34 -0700


On Mar 27,  2:25pm, Blake Barnett wrote:

> On Wed, 2002-03-27 at 14:16, Kevin Buettner wrote:
> > I ended up not using either of these solutions.  All I really care
> > about is pushing the contents of my development directory over to
> > the (unstable) machine as it changes over time.  I ended up writing
> > a little script that interfaces with fam (the File Alteration Monitor)
> > that ships with recent Red Hat releases.  The script uses the services
> > provided by fam to notice when a file has changed and then invokes
> > rsync over ssh to update it on the remote machine.  It's smart about
> > recognizing when a number of files change within a short span of time
> > (e.g. during a cvs update) and syncs these files in a batch rather than
> > individually.
> 
> You should checkout Unison, it was made to do exactly this.  rysnc in
> daemon mode would also work.

I just took a quick look, and while it seems that I might be able to
use Unison in place of rsync in my script, it doesn't appear that it
detects changes as they occur and automatically propogates the changes
to the remote machine.

My script is invoked as follows:

    constant_sync /some/local/path remote_machine:/some/remote/path

It first rsyncs ``/some/local/path'' with ``/some/remote/path'' on
``remote_machine''.  It then uses fam to monitor changes to files in
the ``/some/local/path'' directory hierarchy and rsyncs local files as
they change to the remote machine.

Of course, if I am mistaken about Unison's (or rsync's daemon mode)
capabilities, I'd like to know.  I don't mind giving up my script if
there's some other already existing tool that does this job well.

Thanks for telling me about Unison though.  I wasn't aware of it until
now.  For those that want to get to it quickly without (an almost
equally quick) Google search, the location is:

    http://www.cis.upenn.edu/~bcpierce/unison/

Kevin