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

Re: Excluding a directory from tar

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

Redirecting your archive to /dev/null is a way to make a dry run.

> Petter, curious

Jean-Marc <jean-marc@6jf.be>

Attachment: pgpcRNDOKv2nu.pgp
Description: PGP signature

Reply to: