Tar Question

Bob McClure Jr robertmcclure at earthlink.net
Tue Sep 7 21:01:09 UTC 2004


Please don't top post.

On Tue, Sep 07, 2004 at 01:51:36PM -0700, Nguyen, Minh wrote:
> Try:
> 
>     tar cvfzX ${TAR_FILE} ${EXCLUDE} . 
> 
> where EXCLUDE=/www/test

Umm, I don't think so.  From "man tar":

       -X, --exclude-from FILE
              exclude files listed in FILE

You'd do better to

  tar cvf ${TAR_FILE} `ls /www/*|fgrep -v /www/test`

> -----Original Message-----
> From: Darryl W. DeLao Jr. [mailto:ddelao at oucpm.org]
> Sent: Tuesday, September 07, 2004 1:46 PM
> To: rhn-users at redhat.com; redhat-list at redhat.com; redhat-install-list at redhat.com
> Subject: Tar Question
> 
> 
> 
> Is there a way to create a tar file and exclude a specific directory that is within the directory you want to tar?
> 
>  
> 
> For example, I have a directory called /www/ and in that directory is another directory called  /www/test/  and I want to tar up the /www/ directory but  I do not want the tar to include the /www/test/ directory but I do want the tar to include all the other sub-directories within /www/
> 
>  
> 
> Thanks!
> 
> Darryl

Cheers,
-- 
Bob McClure, Jr.             Bobcat Open Systems, Inc.
robertmcclure at earthlink.net  http://www.bobcatos.com
Grace happens.





More information about the Redhat-install-list mailing list