I am running debian bullseye which comes with rsync 3.2.3. and was struggling 
with writing a correct exclude-from file. I want to exclude everything under 
/tmp and /mnt, but include everything under/mnt/Windows/Users/jba. This is what 
I came up in the end and what works:

+ /mnt/Windows/Users/jba
+ /mnt/Windows/Users
+ /mnt/Windows
- /mnt/Windows/Users/*
- /mnt/Windows/*
- /mnt/*
- /tmp/*

However, it didn't work in the beginning and took me some time to find out, 
that a space at the end (e.g. "+ /mnt/Windows/Users " in the second line) will 
be interpreted and thus, the directory is assumed to be "Users " and not 
"Users". So with the space it just didn't work.

Is this the intended behavior? Its really hard to find this problem because 
trailing spaces are normally not directly visible. And they are dropped in 
every other software (at least the ones I use).

The other thing I was thinking about is, that the above syntax is far from 
being intuitive. Especially if you have long path names it would be much easier 
if the following could be used:

+ /mnt/Windows/Users/jba
- /mnt/*
- /tmp/*

In order to not break compatibility a special character (like "!") could be 
added at the end of the first line. Meaning "match to any subpath of this 
also". So create /mnt/Windows and /mnt/Windows/Users, but not their contents.

However, that's just a proposal. But the behavior of trailing spaces is 
something I guess should be corrected.

jba

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to