wildcards and nested files

Grant emailgrant at gmail.com
Wed Jul 3 03:55:56 MDT 2013


>>> Anyways, the other way to do what you are asking is: rsync -azvi
>>> --exclude-from=excludes.txt --delete --delete-excluded /
>>> user at hostname:
>>>
>>> excludes.txt: + / + /etc + /etc/** + /home + /home/*/ +
>>> /home/*/.maildir/ + /home/*/.maildir/** - - *
>>
>> So the includes are in excludes.txt prefixed with "+ " and the
>> excludes are prefixed with "- - "?
>
> I am not sure where the second - came from.  That line should have
> been "- *" as in exclude everything that I didn't explicitly include
> previously (order matters).  I find it much easier to list both in a
> single file rather than using two since order is so important.

Is there a rule I can apply to figure out the proper order for
includes and excludes?  I found that:

- /folder1/folder2

needs to be above:

+ /folder1/**

but  "- *" needs to be at the very end which is confusing.

- Grant


More information about the rsync mailing list