Mirroring OS X folders with Rsync

jw schultz jw at pegasys.ws
Thu Jul 31 07:24:12 EST 2003

On Wed, Jul 30, 2003 at 11:22:58AM -0500, Adam Behn wrote:
> I'm just looking for some advice on a project I am currently working on.
> I have two OS X servers and I am looking to use rsync to mirror data between
> the two. I just love the fact that rsync only moves the data incrementally.
> It is very efficient and since I'm more of a Linux user and I feel
> comfortable with rsync. I'm just worried that the way the Apple File Sharing
> service handles files from the OS 9 machines is causing rsync to hang while
> rsync is trying to do it's diff on the files.
> Server A has data being placed on the server constantly, from OS 9 clients,
> and then those files are to be moved to server B. The script is running on
> server B and is not being run from cron. It kicks off rsync and then a
> script to change permissions of the files so clients have access to them.
> After both have run the script sleeps for 120 seconds. Plus the script is
> run as root.
> Unfortunately it seems rsync catches files being copied from the OS 9
> clients to the OS X server and hangs. I'm wondering if rsync doesn't see any
> file locking by the Apple Fileserver?
> Has anyone else run into this? Any Suggestions? Do know of a more efficient
> solution?

No one else has reported it.

Rsync has no concept of file locking.  In *ix file locking
is advisory so this isn't a problem.  The only time a
process notices a file lock is when it tries to lock the
file itself; something rsync never does.

Windows has implicit mandatory locks but all they do is
cause open to fail so that rsync skips (with errors) open

If OSX has implemented mandatory locks that cause blocking
on open() or read() rsync would indeed hang until the lock
is released.  In such a case there should be a flag that can
be set on the open() call to either ignore the locks or
fail.  Either would be an improvement on blocking.

I'd suggest you search the OSX resources regarding this.

	J.W. Schultz            Pegasystems Technologies
	email address:		jw at pegasys.ws

		Remember Cernan and Schmitt

More information about the rsync mailing list