Mailing List Archive


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

Re: [tlug] Tar excluding some folders



On Sat, Feb 14, 2004 at 07:49:07PM +0900, Charles Muller wrote:
> susumu> It must be in relative path in the archive.
> 
> stephen> This isn't quite true; it should be relative to whatever tar considers
> stephen> the current directory.  That's usually `pwd`, but can be changed with
> stephen> the -C flag.  This detail is not relevant to Chuck's case, since he's
> stephen> put the tarball in the current directory and doesn't use -C. 
> 
>     tar cvzfP /mnt/win_d/chuck-exclude.tar.gz -X /home/chuck/chuck-exclude.txt /home/chuck
> 
> Unless I'm missing something, I thought that I was putting the tarball
> in /mnt/win_d. (?)
> 
> Anyway, reading Stephen's comments, I tried this 
> 
>     tar cvzfP /mnt/win_d/chuck-exclude.tar.gz -C /home/chuck/ -X chuck-exclude.txt /home/chuck
> 
> 
> which also runs, but still no elimination of unwanted directories.

It's the path *inside* the exclude file that must be relative to tar's
idea of pwd. In your original post your paths (in the exclude file) all
begin with a / which is an absolute, not relative, path.

Try, for example, running tar from the root directory, with your
original exclude file, only strip the leading slashes.

Exclude file contents:

home/chuck/Desktop
home/chuck/.kde
home/chuck/evolution
...  etc.

Command:
tar cvzfP /mnt/win_d/chuck.tar.gz  /home/chuck -X path-to-file/chuck-exclude

Best,
Ed Wright

 
> Anyway, I can do it the other way around, i.e., running off an
> "inclusions" file rather than exclusions file, and it seems like it will
> basically take the same type of effort to maintain one or the
> other. Nonetheless, it would be interesting to learn if it is indeed
> possible.
> 


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links