Patch: Better handling for rsync temporary files

Wayne Davison wayned at samba.org
Wed Oct 26 12:30:11 MDT 2011


On Wed, Oct 19, 2011 at 9:59 PM, Alex Jurkiewicz <alex at jurkiewi.cz> wrote:

> These two patches change how rsync handles temporary files on the receiver
> side. The first patch adds a static token to rsync's temporary filenames.
> The second patch ignores files with this token when using --cvs-ignore.
>

[Sorry for the delay in commenting on this.]  I like the idea of making the
temp files follow a more easily excluded pattern, but the addition of such a
long string to the suffix could make the names overflow more easily on
really long paths.  Perhaps switching the name around to be
.FILE_NAME_PART.XXXXXX.rsynctmp and extending the code that trims the name
down to allow the .rsynctmp to be trimmed out if absolutely necessary would
be a good solution.  Then, an exclude of .*.rsynctmp would exclude all the
temp files that didn't get truncated at the limit (which would be the
majority of the temp files).  Doing the reordering would require the
mkstemps() function, so any host that didn't support that wouldn't get the
new .rsynctmp suffix.

Here's a patch that should handle the above idea:
http://pastebin.com/UTbtFu8Ta

I don't think I'd add the temp files to the cvs exclusion code, since normal
single-use copying should be removing old temp files, not ignoring them.
 Thus, it should be up to the user to choose to exclude the temp files or
not.

..wayne..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20111026/c6a6bdcf/attachment.html>


More information about the rsync mailing list