Red Hat Bugzilla – Bug 13115
tar --exclude and --exclude-from broken
Last modified: 2014-01-21 17:48:01 EST
The tar versions in RedHat 6.1 and 6.2 have problems with exclusions and
wildcards. I will give an example, this is much easier.
File tree looks like this:
bash$ tar -cf - --exclude '*/RCS*' cmds | tar -tf -
bash$ tar -cf - --exclude '*/RCS/*' cmds | tar -tf -
When the tree is one deep it does work, however deeper recursion doesn't.
Tar version 1.12 from RedHat 6.0 works fine.
Hm, now that I look at ALL tar bugs (instead of only the ones for 6.2) I see it
has been reported twice already. How about a fix or downgrade?
According to the GNU tar maintainers, this is not a bug but intended
curiously this bug isn't QUITE compliant with what they are claiming.
if I have a dir tree like:
if I have an exclude file that looks like:
then the mp3's will be excluded but the .netscape/cache dir will not be excluded
if I change the exclude file to look like:
then it will exclude all files/dirs named cache and all .mp3 files.
I looked through the source and it appears that they have a specific allowance
for files containing slashes but I think its just not working.