Tar Question

gerrynix gerrynix at yahoo.com
Tue Sep 7 21:09:02 UTC 2004


--- Bob McClure Jr <robertmcclure at earthlink.net> wrote:

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

Yep. Bob's suggestion is probably faster for a single object
as you have. I use an exclude file with a long listing of
files and reuse the exclude_file frequently.
--
Nix
> 
> > -----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.
> 
> 
> _______________________________________________
> Redhat-install-list mailing list
> Redhat-install-list at redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-install-list
> To Unsubscribe Go To ABOVE URL or send a message to:
> redhat-install-list-request at redhat.com
> Subject: unsubscribe
> 





More information about the Redhat-install-list mailing list