2017-01-05 16:25 GMT+01:00 Robert Nichols <rnicholsnos...@comcast.net>:
> On 01/04/2017 01:00 PM, Ilario wrote:
>>
>> Excluding a hidden file without full path doesn't rise an error (as
>> happens with non hidden files) and copies it anyway
>
> The only thing that is strange
> here is that you are not getting the "cannot match any files in the
> base directory" error.  For some reason, dotfiles in an exclude do
> not trigger that message.

This is exactly my point :)

I think I spotted something related looking into the code:

https://github.com/sol1/rdiff-backup/blob/4864f2fcc195a1a0b3d303766505b58f16223bff/rdiff-backup/rdiff_backup/selection.py#L402

That line should rise an error if the exclusion doesn't include the
origin path. But it just compares text strings, without a directory
separator (e.g. the slash).

So in some cases (like mine) the error doesn't rise, e.g.:
rdiff-backup --exclude data origin backup # it fails, as expected
rdiff-backup --exclude origin/data origin backup # it does not fail,
as expected (doesn't matter if origin/data esists)
rdiff-backup --exclude origindata origin backup # it does not fail,
but it should!

Fixing the linked line of code should be easy (appending a "/"
literally or using os.path.join() prior to string comparison).

_______________________________________________
rdiff-backup-users mailing list at rdiff-backup-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki

Reply via email to