avoid rsync deleting vanished files on receiver

Carlos Carvalho carlos at fisica.ufpr.br
Fri Oct 23 19:56:50 MDT 2009


Hans-Christian Jehg (hc at jehg.dk) wrote on 23 October 2009 17:32:
 >The circumstance where this happens is now known, it is when requests
 >to the shared in files returns "permission denied" from the file
 >server...
[snip]
 >I am not at all sure where it goes wrong, but in the end the result is
 >that rsync thinks certain files has disappeared. It could for instance
 >go wrong in the cifs client, but also in rsync when trying to read the
 >remote file (I am not using --ignore-errors) if no proper read checking
 >is in place (I do not think that this is the case but I would mention
 >it anyway).

 >My immediate problem is that rsync proceeds happily and deletes any
 >vanished files in the end (--delete-after).

 >rsync stops with exit code 24, but by then the damage is already done
 >(files deleted) .

Strange, I have code 23 when rsync gets permission denied. This is
important because vanished files are a normal occurrence and files
should be removed in this case. OTOH, code 23 is an error, and rsync
should not do deletions if you don't use --ignore-errors.

If the exit status is 23 you're likely hitting this bug:

Matt McCutchen (matt at mattmccutchen.net) wrote on 23 September 2009 22:19:
 >On Thu, 2009-09-17 at 20:59 +0200, Enno Middelberg wrote:
 >> Here the two directories which couldn't be read have been deleted from
 >> the target directory (ie, the files contained in them were deleted,
 >> the directories did still exist, if I remember correctly). If I
 >> understand the man page correctly, rsync should not delete files from
 >> the target directory when an error occurs. This can be overridden with
 >> the "--ignore-errors" command line switch, but this switch has
 >> definitely not been used.
 >
 >Maybe you are hitting this issue:
 >
 >https://bugzilla.samba.org/show_bug.cgi?id=6719


More information about the rsync mailing list