in the tarpit -- cannot exclude cache

Patrick Asselman iceblink at seti.nl
Fri Oct 12 06:21:24 UTC 2012


On 2012-10-11 19:59, Kevin O'Gorman wrote:
> On Thu, Oct 11, 2012 at 10:39 AM, Nils Kassube <kassube at gmx.net> 
> wrote:
>> Kevin O'Gorman wrote:
>>> I've done a "touch /home/kevin/.cache/CACHEDIR.TAG" to mark the
>>> directory I want to exclude, but it's not getting excluded.
>>> The command runs as root, and the complete command line is
>>>
>>>     sudo tar --absolute-names --one-file-system --exclude-caches 
>>> -czf
>>> treat.home.manual-121011.tgz /home
>>>
>>> and changing the type of --exclude does not help.
>>
>> I'm not sure if it matters, but according to the man page on my 
>> 10.04
>> machine the option would be "-exclude-caches" with only one "-" at 
>> the
>> start.
>
> Thanks.
>
> That's the sort of thing that I could easily miss, but my 12.04 man
> page uses two dashes for
>
>      --exclude-caches
>            exclude contents of directories containing CACHEDIR.TAG,
>
>      --exclude-caches-all
>            exclude directories containing CACHEDIR.TAG
>
>      --exclude-caches-under
>            exclude everything under directories containing 
> CACHEDIR.TAG
>
> And I would expect it to complain if I got it wrong.  With only one
> dash, it complains
>      tar: invalid option -- 'e'
>
> --
> Kevin O'Gorman
>
> programmer, n. an organism that transmutes caffeine into software.

It smells like you are putting a CACHEDIR.TAG file in all the 
directories you want to exclude, but you should probably create only one 
CACHEDIR.TAG file that shows what you consider to be cache dirs, after 
which tar will exclude all those types of directories.

If it is not just cache dirs you want to exclude, you can create an 
exclude file and specify in the file all the directories you do not want 
to be in the tar ball.

Best regards,
Patrick Asselman





More information about the ubuntu-users mailing list