in the tarpit -- cannot exclude cache

Kevin O'Gorman kogorman at gmail.com
Sat Oct 13 02:32:41 UTC 2012


On Thu, Oct 11, 2012 at 11:21 PM, Patrick Asselman <iceblink at seti.nl> wrote:
> 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.

It's not clear this can be done.

> 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.

I'd rather put it where the cache is rather than in some separate
place with no obvious connection to the directory unless you're
reading my script.

As mentioned in a previous posting, the --exclude-caches thing
requires specific contents for the tag file.  I'll use
--exclude-tag=CACHEDIR.TAG instead.  This will work nicely.

-- 
Kevin O'Gorman

programmer, n. an organism that transmutes caffeine into software.




More information about the ubuntu-users mailing list