Bug 10343
Summary: | rsync --exclude '*' --include '*' doesn't work as documented | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Steve Coile <scoile> |
Component: | rsync | Assignee: | Bill Nottingham <notting> |
Status: | CLOSED RAWHIDE | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.0 | CC: | rvokal |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2000-04-05 20:11:40 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Steve Coile
2000-03-25 05:34:41 UTC
Ugh. Make this a documentation enhancement request. Turns out that the ordering is significant. Specifically, if you want to include only specific files and exclude all else, you need to identify the files to include (using "--include") *first*, *then* exclude everything else. Thus, the following are equivalent: rsync rsync --include '*' --exclude '*' but the following are not: rsync --include '*' --exclude '*' # excludes nothing rsync --exclude '*' --include '*' # excludes everything The documentation should make this more clear. The current (2.4.2) documentation says: o --include "*/" --include "*.c" --exclude "*" would include all directories and C source files and, also: rsync builds a ordered list of include/exclude options as specified on the command line. When a filename is encoun- tered, rsync checks the name against each exclude/include pattern in turn. The first matching pattern is acted on. This seems to imply that patterns are checked in the order on the command line. |