why more than one temp file for a single rsync download?

Carlos Carvalho carlos at fisica.ufpr.br
Wed Feb 24 20:52:58 MST 2010

Felipe Alvarez (felipe.alvarez at gmail.com) wrote on 25 February 2010 08:59:
 >A large file (2+ GB) needs to be transfered, but I see more than one
 >temp file for it. One temp file is larger than the other, but this
 >morning I tried to rsync again, and it DID NOT resume the largest temp
 >file - it resumed the smaller one. Is there an explanation of this
 >behaviour? I didn't want --inplace because I don't need it (I have the
 >disk space).
 >-rw-r--r-- 1 felipe users 2137544747 2010-02-24 07:05 en_windows_7_professional_x86_dvd_x15-65804.iso
 >-rw------- 1 felipe users 2425356288 2010-02-25 03:53 .en_windows_7_professional_x86_dvd_x15-65804.iso.FRqmSF
 >-rw------- 1 felipe users 2206466048 2010-02-25 08:55 .en_windows_7_professional_x86_dvd_x15-65804.iso.H4iErJ
 >-rw-r--r-- 1 felipe users         90 2010-02-24 23:46 en_windows_7_professional_x86_dvd_x15-65804.iso.sha1
 >The original is
 >-rw-r--r--  1 felipe users 2501894144 2009-08-06 20:57 en_windows_7_professional_x86_dvd_x15-65804.iso
 >Why are two temp files saved here?

Probably because the previous two transfers were aborted. Normally
rsync removes the temporary if at all possible; it's only left if the
interruption was forceful, such as kill -9 or a machine crash.

 >Why did it resume the smaller one?

It didn't. It started from the same point all 3 times. So, if the file
didn't exist in the destination the 3 transfers started from zero. The
temporary is not used, rsync behaves as if it doesn't exist. Which
means it's not removed either, unless you do a recursive run with --delete.

 >What should I do to avoid this in the future?

If you use --partial and an interruption happens rsync moves the
temporary to the final name and uses it next time to speed up the
update. However if the interruption doesn't give rsync the opportunity
to move the temporary, as happened to you, nothing can be done.

More information about the rsync mailing list