man rsync, section "FILTER RULES" says:
"use ’**’ to match anything, including slashes."
This is incorrect. '**' does not match empty strings.
The description should be:
"use ’**’ to match any non-empty string, including slashes."
This would be more in line with what '*' does ( "a ‘*’ matches any non-empty path component (it stops at slashes)." )
"**" certainly does match empty strings, even at the start of a path (e.g. **/foo will exclude a "foo" at the root of the transfer). If you're seeing an issue, please be specific in what is not working for you.
Hi, seems like you're right. Sorry for bothering you :-)
On the other hand, the manpage says:
"a ’*’ matches any non-empty path component (it stops at slashes)."
Although '*' seems to match non-empty and empty(!) filename components.
Eg: 'foo*' matches the file foo and foobar.
~$ mkdir test-src test-dest; touch test-src/foo test-src/foobar
~$ rsync -av --exclude 'foo*' test-src/ test-dest
building file list ... done
sent 74 bytes received 20 bytes 188.00 bytes/sec
total size is 0 speedup is 0.00
I've tested this on rsync 2.6.9 and 3.0.3.
Isn't this a mistake in the manpage then?
The "non-empty" qualifier in the manpage was certainly deceiving, and has been removed.