| Re: tar --remove-files Philipp Ghirardini wrote:
> jellybean stonerfish wrote:
>> On Sun, 15 Jun 2008 18:50:56 +0200, Philipp Ghirardini wrote:
>>
>>> jellybean stonerfish wrote:
>>>> On Sun, 15 Jun 2008 14:54:11 +0200, Philipp Ghirardini wrote:
>>>>
>>>>
>>>>> I have the following tar command:
>>>>>
>>>>> tar --remove-files -C /net_tests/tests/dir_one -czf
>>>>> /net_tests/tests/dir_one/myzip.tar.gz . --exclude=file3
>>>>> --exclude=myzip.tar.gz
>>>>> I think the problem is that the command is packing the '.' and so it
>>>>> is trying to remove it what fails of course. I also creates a
>>>>> subdirectory '.' in the archive. Actually it doesn't matter because
>>>>> when unpacking the archive that has no effect.
>>>>>
>>>>> Philipp
>>>> Can you use a * to get all the files rather than a . to get the dir?
>>>>
>>>> stonerfish
>>>>
>>> No, I tried that but than I got :
>>
>> Ok I think I see something.
>> What dir are you in when running tar? The . means what in your
>> original post?
>> Are you in /net_tests/tests/dir_one
>> if not try (backslashes added)
>>
>> tar --remove-files -C /net_tests/tests/dir_one -czf \
>> /net_tests/tests/dir_one/myzip.tar.gz /net_tests/tests/dir_one/* \
>> --exclude=file3 --exclude=myzip.tar.gz
>>
>>
>> sf
>>
>>
>>
>
> Using this command exits with 0 but now i have the problem again that
> the archiv consists the whole path (/net_tests/tests/dir_one/...).
> replacing this part with ./* doesn't work.
>
> regards Philipp
If in bash, you could try with set -x and see if you get something
useful upon invocation of tar. |