DO NOT REPLY [Bug 3461] New: rsync is not atomic when temp-dir is on different device

bugzilla-daemon at bugzilla-daemon at
Sat Jan 28 19:18:06 GMT 2006

           Summary: rsync is not atomic when temp-dir is on different device
           Product: rsync
           Version: 2.6.7
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: core
        AssignedTo: wayned at
        ReportedBy: Simen.Gaure at
         QAContact: rsync-qa at

I do have a problem when rsync'ing files when I specify --temp-dir on a
different device than the destination.

An example:

# pwd
# rsync --temp-dir /disk2 remote::file.dat file.dat

When the transfer finishes, the temporary file on /disk2 is copied directly to
/disk1/file.dat resulting in /disk1/file.dat being truncated and gradually
filled.  When temp-dir is on the same device, the new file is created with a
temporary name and then renamed, so that at no point /disk1/file.dat is

The problem could be alleviated by letting reboust_rename() in util.c
optionally copy the file to a temporary name on the target device, and then
rename it. 

This is actually quite a problem for us, we want the temporary file on a
different device for performance.  When it's on the same device, rsync creates
both heavy read and heavy write traffic to the same disk (which is otherwise
quite idle), resulting in poor performance (much poorer than what the extra
copy incurs.)

Configure bugmail:
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the rsync mailing list