help-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-tar] Need specifying path for exclude.


From: Jakob Bohm
Subject: Re: [Help-tar] Need specifying path for exclude.
Date: Fri, 04 Jul 2014 18:47:51 +0200
User-agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 7/4/2014 5:00 PM, Randy Powers wrote:
First here is the directory structure:
test/
test/subtest1/
test/subtest1/subtest11.xml
test/subtest1/subtest12.xml
test/subtest1/subtest13.xml
test/subtest1/subtest2/
test/subtest1/subtest2/subtest21.xml
test/subtest1/subtest2/subtest22.xml
test/subtest1/subtest2/subtest23.xml
test/subtest2/
test/subtest2/subtest21.xml
test/subtest2/subtest22.xml
test/subtest2/subtest23.xml
test/subtest3/
test/subtest3/subtest31.xml
test/subtest3/subtest32.xml
test/subtest3/subtest33.xml
test/test1.xml
test/test2.xml
test/test3.xml

I want to archive test. I want to exclude the directory
test/subtest1/subtest2

I have tried every combination of this command that I can think of and
nothing has worked.
tar -cvf test.tar test --exclude=test/subtest1/subtest2
tar -cvf test.tar test --exclude=test/subtest1/subtest2/
tar -cvf test.tar test --exclude=subtest1/subtest2
tar -cvf test.tar test --exclude=subtest1/subtest2/
tar -cvf test.tar test --exclude="test/subtest1/subtest2"
tar -cvf test.tar test --exclude="test/subtest1/subtest2/"
tar -cvf test.tar test --exclude="subtest1/subtest2"
tar -cvf test.tar test --exclude="subtest1/subtest2/"
tar -cvf test.tar test --exclude='test/subtest1/subtest2'
tar -cvf test.tar test --exclude='test/subtest1/subtest2/'
tar -cvf test.tar test --exclude='subtest1/subtest2'
tar -cvf test.tar test --exclude='subtest1/subtest2/'

tar -cvf test.tar --exclude=test/subtest1/subtest2 test
.... all the same cases as above

tar -c -v --exclude=test/subtest1/subtest2 test -f test.tar
.... all the same cases as above

I have also tried removing the "=" and converting to all absolute paths.
Everything has produced the exact same result. The
test/subtest1/subtest2 is archived.

I am using GNU tar on Windows 7 Service Pack 1. Here is the --version
result:
tar (GNU tar) 1.13

Copyright (C) 1988, 92,93,94,95,96,97,98, 1999 Free Software Foundation,
Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Written by John Gilmore and Jay Fenlason.

How was this (15 year old) tar compiled?, and from what shell was it invoked?

I suspect that the combination of posix emulation layer compiled in and
command line shell used for the invocation causes your partially quoted
arguments such as --exclude='something' to reach the code inside tar
with the quotes intact, thus matching nothing.  You may have better luck
with "--exclude=something" so the quotes are at the outer edges of the
argument and get stripped off by the shell or posix emulation layer.

Many years ago I used tar to create archives using excludes. I have
tried repeating what I did back then but got the same result.


Another possibility is some oddity in the meaning of the --exclude
option in GNU tar 1.13.  I don't remember its old docs that clearly.


Enjoy

Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S.  http://www.wisemo.com
Transformervej 29, 2730 Herlev, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded



reply via email to

[Prev in Thread] Current Thread [Next in Thread]