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

Re: Excluding a directory from tar



On Mon, 13 Apr 2015 18:41:50 +0200
Jean-Marc <jean-marc@6jf.be> wrote:

> Mon, 13 Apr 2015 16:15:42 +0200
> Petter Adsen <petter@synth.no> écrivait :
> 
> hi Petter,
> 
> > I've been trying to make a tarball of my home directory, but I want
> > to exclude ~/.cache. First I tried '--exclude="~/.cache", but it
> > didn't work. Neither did '--exclude="~/.cache/*".
> 
> Can you send the command you used ?
> It will be easier to find what's wrong.
> 
> > 
> > I got it working by creating an empty file in ~/.cache and using the
> > filename as an argument to "--exclude-tag-under", but what was I
> > doing wrong when trying to use "--exclude"?
> 
> Maybe the prefix you used (~).
> 
> Try with
> 
> tar -cvf /dev/null --exclude=.cache $HOME | less

That was, in essence, the command I used, and both you and Vincent are
right, the "~" was not expanded. For some reason I was absolutely
convinced that I had tried without it, but clearly I didn't. My shell
history confirms this.

So thank you, both, it is now working perfectly. :)

Petter

-- 
"I'm ionized"
"Are you sure?"
"I'm positive."

Attachment: pgpck1gqaV1IX.pgp
Description: OpenPGP digital signature


Reply to: