DO NOT REPLY [Bug 4764] Wrong include/exclude descriptions
samba-bugs at samba.org
samba-bugs at samba.org
Thu Jul 5 22:13:18 GMT 2007
https://bugzilla.samba.org/show_bug.cgi?id=4764
tps at vr-web.de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|INVALID |
------- Comment #3 from tps at vr-web.de 2007-07-05 17:13 CST -------
I have tried that too, but without any luck:
INCLUDE/EXCLUDE PATTERN RULES
You can include and exclude files by specifying patterns using
the "+", "-", etc. filter rules (as introduced in the FILTER
RULES section above). The include/exclude rules each specify a
pattern that is matched against the names of the files that are
going to be transferred. These patterns can take several forms:
o if the pattern starts with a / then it is anchored to
a particular spot in the hierarchy of files, oth-
erwise it is matched against the end of the pathname.
This is similar to a leading ^ in regular expres-
sions. Thus "/foo" would match a file named "foo" at
either the "root of the transfer" (for a global
rule) or in the merge-fileâs directory (for a per-
directory rule). An unqualified "foo" would match any
file or directory named "foo" anywhere in the tree
because the algorithm is applied recursively from the
top down; it behaves as if each path component gets
a turn at being the end of the file name. Even the
unanchored "sub/foo" would match at any point in the
hierarchy where a "foo" was found within a direc-
tory named "sub". See the section on ANCHORING
INCLUDE/EXCLUDE PATTERNS for a full discussion of how
to specify a pattern that matches at the root of
the transfer.
o if the pattern ends with a / then it will only match
a directory, not a file, link, or device.
if this where true, an --exclude-from file
+ 6/
- *
should only match directories named '6'. For example
core/6
update/6
and so on. Could you please explain me, why I am seeing with this rule above
$ rsync -av --exclude-from=exclude.txt rsync://mirrors.kernel.org/fedora/
[...]
receiving file list ... done
drwxr-xr-x 77 2007/05/21 23:37:48 .
sent 101 bytes received 787 bytes 118.40 bytes/sec
total size is 0 speedup is 0.00
The driectories '6' are not matched at all --- and there are some of them
within this hierarchy! At least these I expect to be listed!
Changing the rule to
+ 6/
+ 6/*
- *
if following the description should make it match all files within any
directory named '6'. But again:
$ rsync -av --exclude-from=exclude.txt rsync://mirrors.kernel.org/fedora/
[...]
receiving file list ... done
drwxr-xr-x 77 2007/05/21 23:37:48 .
sent 110 bytes received 787 bytes 94.42 bytes/sec
total size is 0 speedup is 0.00
o rsync chooses between doing a simple string match and
wildcard matching by checking if the pattern con-
tains one of these three wildcard characters: â*â,
â?â, and â[â .
o a â*â matches any non-empty path component (it stops
at slashes).
if this where true, the rule
+ */*/*
- *
would match any file or directory like
core/6/...
But:
$ rsync -av --exclude-from=exclude.txt rsync://mirrors.kernel.org/fedora/
[...]
receiving file list ... done
drwxr-xr-x 77 2007/05/21 23:37:48 .
sent 104 bytes received 787 bytes 93.79 bytes/sec
total size is 0 speedup is 0.00
No match at all!
o use â**â to match anything, including slashes.
o a â?â matches any character except a slash (/).
o a â[â introduces a character class, such as
[a-z] or [[:alpha:]].
o in a wildcard pattern, a backslash can be used to
escape a wildcard character, but it is matched liter-
ally when no wildcards are present.
o if the pattern contains a / (not counting a trailing
/) or a "**", then it is matched against the full
pathname, including any leading directories. If
the pattern doesnât contain a / or a "**", then it
is matched only against the final component of the
filename. (Remember that the algorithm is
applied recursively so "full filename" can
actually be any portion of a path from the starting
directory on down.)
If this where true, the rule
+ /**/6
- *
would match all files or directories '6'. But:
$ rsync -av --exclude-from=exclude.txt rsync://mirrors.kernel.org/fedora/
[...]
receiving file list ... done
drwxr-xr-x 77 2007/05/21 23:37:48 .
sent 104 bytes received 787 bytes 93.79 bytes/sec
total size is 0 speedup is 0.00
No match at all!
o a trailing "dir_name/***" will match both the directory
(as if "dir_name/" had been specified) and all
the files in the directory (as if "dir_name/**"
had been specified). (This behavior is new for version
2.6.7.)
--
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
More information about the rsync
mailing list