File Locking - Tools

This is a discussion on File Locking - Tools ; > A different Kyle wrote: > I have a situation that requires the files that rsync is > uploading/downloading to be locked. The reason is because it is possible > to have more than one copy of rsync running and ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: File Locking

  1. File Locking

    > A different Kyle wrote:
    > I have a situation that requires the files that rsync is
    > uploading/downloading to be locked. The reason is because it is possible
    > to have more than one copy of rsync running and without file locking,
    > the additional copies simply retry to upload/download a file that a
    > previous copy is already working on.


    >> The way I solved this problem for a data-mirroring system was to use a
    >> small wrapper script that ensures only one invocation of rsync is ever
    >> running at one time. This proved to be a robust solution for our situation.


    >> --Kyle


    Thanks for the idea but I sometimes need more than one copy to run at the same time so that won't work. File locking is about the only option I can see.

    Thank you.
    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


  2. Re: File Locking

    On Mon 18 Aug 2008, lists@trcintl.com wrote:
    >
    > >> The way I solved this problem for a data-mirroring system was to use a
    > >> small wrapper script that ensures only one invocation of rsync is ever
    > >> running at one time. This proved to be a robust solution for our situation.

    >
    > >> --Kyle

    >
    > Thanks for the idea but I sometimes need more than one copy to run at the same time so that won't work. File locking is about the only option I can see.


    If you need to run more than one rsync over the same tree at the same
    time, you may need to rethink your tree layout and/or your approach to
    whatever problem you're trying to fix. Running two rsyncs sequentially
    will usually be faster than two concurrent ones, as that might cause
    disk thrashing (the heads are continually seeking to and from where the
    respective rsync processes are working).


    Paul Slootman
    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


  3. Re: File Locking

    On Mon, Aug 18, 2008 at 10:36:18AM -0500, lists@trcintl.com wrote:
    > In other words, I can't wait until the first run has completed the
    > large copy to begin copying additional files. I want to start a
    > second, third, fourth, etc copy that begins working on any additional
    > files that may have been placed on the source side.


    One way is to split things into two separate rsync scripts, each with
    its own single-run locking. One would use --max-size=100MB and the
    other would use --min-size=100MB (or whatever size you like). That way
    the small-file rsync can run more frequently than the large-file rsync.

    ...wayne..
    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


+ Reply to Thread