File Locking - Tools

This is a discussion on File Locking - Tools ; First let me say that rsync is a wonderful program and thank you all for the hard work that went into it's creation. On to my question. I have a situation that requires the files that rsync is uploading/downloading to ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: File Locking

  1. File Locking

    First let me say that rsync is a wonderful program and thank you all for the hard work that went into it's creation. On to my question. 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. What I am hoping for is a way for rsync to notice that the file is already being copied and therefore move on to the next file.

    I found a previous post from 2005 where someone made a patch for rsync that used flock to lock files but I can't find any other mention of the patch? Is this possible with rsync perhaps via a patch? If not, any other ideas? By the way, I am using rsync on Windows under cygwin.

    Thanks to all.

    -Kyle

    --
    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

    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
    --
    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