Teodor MICU
2009-Apr-23 17:40 UTC
Excluded directories at rsync (was "--filter, missing in action")
On Thu, 23 Apr 2009 17:32:37 +0200 Paul Slootman <paul+rsync@wurtel.net> wrote:> --delete-excluded will screw this up.Yes, this is why I don't use it. This is probably a bug because the excluded directories with "- DIR/**" will became empty on all receivers (SLAVE hosts). But with just "--delete" the excluded directories are not synchronized with the MASTER host, which works as designed. The annoying side effect is that on all SLAVE hosts I get some garbage directories like "parent1" "parent2" .. that contains only the excluded "DIR" directory. This is not desired because these "parent*" directories were deleted on the MASTER host but cannot be deleted with rsync on the SLAVE hosts because it contains one excluded directory named "DIR". I'm searching for a solution/workaround to this problem but so far I don't see any. I think a new parameter like "--delete-excluded-subdir" would be needed to cover this case. This parameter should have no effect if the "--delete" parameter was not given, but in conjunction with it should delete all the directories that were deleted at the source (MASTER host) even in the case that it contains some sub-directories that are on the exclude list. Any other idea? Thanks
Wayne Davison
2009-Apr-25 18:53 UTC
Excluded directories at rsync (was "--filter, missing in action")
On Thu, Apr 23, 2009 at 08:40:12PM +0300, Teodor MICU wrote:> This is not desired because these "parent*" directories > were deleted on the MASTER host but cannot be deleted with rsync on the > SLAVE hosts because it contains one excluded directory named "DIR".You should either anchor your excludes so they only match the items you want them to (not extra subdirs), or you should use the perishable option to the exclude rule so that it won't affect the removal of a parent directory. ..wayne..