Re: does rsync lock the destination file?

From: rc (rc_at_networkz.ch)
Date: 12/05/04

  • Next message: Robert Harris: "Re: Problem related with Subnetting"
    Date: 5 Dec 2004 13:06:10 -0800
    
    

    mazzawi@gmail.com (elia Mazzawi) wrote in message news:<518a5d0.0412031357.6d5cae38@posting.google.com>...
    > does rsync send the file over to a temporary file then moves the new
    > file to overwrite the old one? if it does then it would be safe to
    > assume that an application can never read 1/2 a file while its in
    > transit.

    hi elia

    rsync uses temporary file names, as you can see in this example:

    rc@caja:/tmp $ mkdir d1 d2
    rc@caja:/tmp $ cd d1/
    rc@caja:/tmp/d1 $ dd if=/dev/zero of=test.file bs=1M count=512
    512+0 records in
    512+0 records out
    rc@caja:/tmp/d1 $ rsync test.file /tmp/d2 &
    [1] 3800rc@caja:/tmp/d1 $ ls -las ../d2/
    ...
    24832 -rw------- 1 rc users 25427968 Dec 5 21:58 .test.file.1ocy6g
    ..some time later...
    [1]+ Done rsync test.file /tmp/d2
    rc@caja:/tmp/d1 $ ls -las ../d2/
    ...
    524288 -rw-r--r-- 1 rc users 536870912 Dec 5 22:00 test.file

    best regards
    christian ramseyer


  • Next message: Robert Harris: "Re: Problem related with Subnetting"

    Relevant Pages

    • Re: does rsync lock the destination file?
      ... does rsync send the file over to a temporary file then moves the new ... file to overwrite the old one? ... transit. ...
      (comp.unix.programmer)
    • Re: rsync - unusual or corrupted warning - (.jVPNZY": No such file or directoryicon)
      ... That's a good point about a file with possible control characters. ... the rsync, and did a "merge" on everyone else's OSX excludes, and then ... which seems to imply it is a temporary file. ... If I could get hold of the rsync code, recompile it and add some debug ...
      (comp.unix.questions)
    • questions on rsync for AIX
      ... to running rsync in daemon mode. ... I can use rsync between two AIX boxes if rsync is in the remote path ... it is using a temporary file on the remote ... I was hoping that having rsync in daemon mode, ...
      (comp.unix.aix)
    • Re: rsync copying files it doesnt need to
      ... Dave Mitchell wrote: ... have changed - eg by creating and then deleting a temporary file in the directory. ... rsync will have to update the last modified timestamp on the remote directorry. ...
      (Fedora)
    • Re: Checking if a file exists
      ... int main(int argc, char *argv) ... int overwrite = 0; ... "Unable to create temporary file" ... The very worst thing that could happen is that the destination filename ...
      (comp.lang.c)