ERICSON,MATHEW (A-Australia,ex1) [[EMAIL PROTECTED]] writes:

> Is there any way to prevent rsync from trying to sync a file it is
currently
> transferring?

Two distinct rsyncs can't really tell for sure when they overlap on a
file (after all those temporary files might be created by some other
utility that just happens to use a similar convention).

It sounds like you're running rsync on a schedule that is just too
fast for the transfer you are trying to do.  E.g., if the transfer is
going to take more than an hour, don't start rsync hourly, but make it
every two hours or whatever.  As it is, the overlap is just making
things even worse for your overall transfer since you'll have two
users of the same CPU and bandwidth resources between your systems.

Of course, there's a point at which you can space things too widely
just to be safe to prevent an overlap.  But you can also impose some
control externally to rsync.  For example, you might wrap the rsync
process in a control script that dumps the pid for the rsync it is
running into a control file - it can also check for that control file
(and if its pid matches a running rsync) before starting up the
process.  That way you can schedule it fairly rapidly, but if the
previous run hasn't completed, the next one will be skipped.

-- David

/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: [EMAIL PROTECTED]  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/

Reply via email to