RE: UNIX OT: exclude files in tar

2003-11-26 Thread Stephen.Lee

Expanding the logic to its logical conclusion, we produce philosophies
similar to that found at www.despair.com.

CONSULTING: If you aren't part of the solution, then there is good money to
be made in prolonging the problem.

> -Original Message-
> 
> I like that logic!  I might just start (ab)using Perl now.
> 
> Thanks to all replies.  Now I've got a few options to play 
> around with to do
> this 'exclude files' and not necessarily tar .
> 
> 
> > -Original Message-
> > 
> > 
> > 
> > On 11/25/2003 11:44:26 AM, [EMAIL PROTECTED] wrote:
> > > 
> > > Maybe can use -prune option of find to send file list to tar:
> > > 
> > 
> > Why do it in a simple way when there is an opportunity to 
> > (ab)use perl?
> > 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: <[EMAIL PROTECTED]
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


RE: UNIX OT: exclude files in tar

2003-11-25 Thread Ross Collado
I like that logic!  I might just start (ab)using Perl now.

Thanks to all replies.  Now I've got a few options to play around with to do
this 'exclude files' and not necessarily tar .

Rgds,
Ross

> -Original Message-
> From: Mladen Gogala [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, 26 November 2003 6:25 AM
> To: Multiple recipients of list ORACLE-L
> Subject: Re: UNIX OT: exclude files in tar
> 
> 
> 
> On 11/25/2003 11:44:26 AM, [EMAIL PROTECTED] wrote:
> > 
> > Maybe can use -prune option of find to send file list to tar:
> > 
> 
> Why do it in a simple way when there is an opportunity to 
> (ab)use perl?
> 
> Mladen Gogala
> Oracle DBA
> 
> 
> 
> Note:
> This message is for the named person's use only.  It may 
> contain confidential, proprietary or legally privileged 
> information.  No confidentiality or privilege is waived or 
> lost by any mistransmission.  If you receive this message in 
> error, please immediately delete it and all copies of it from 
> your system, destroy any hard copies of it and notify the 
> sender.  You must not, directly or indirectly, use, disclose, 
> distribute, print, or copy any part of this message if you 
> are not the intended recipient. Wang Trading LLC and any of 
> its subsidiaries each reserve the right to monitor all e-mail 
> communications through its networks.
> Any views expressed in this message are those of the 
> individual sender, except where the message states otherwise 
> and the sender is authorized to state them to be the views of 
> any such entity.
> 
> -- 
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> -- 
> Author: Mladen Gogala
>   INET: [EMAIL PROTECTED]
> 
> Fat City Network Services-- 858-538-5051 http://www.fatcity.com
> San Diego, California-- Mailing list and web hosting services
> -
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).
> 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Ross Collado
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Re: UNIX OT: exclude files in tar

2003-11-25 Thread Mladen Gogala

On 11/25/2003 11:44:26 AM, [EMAIL PROTECTED] wrote:
> 
> Maybe can use -prune option of find to send file list to tar:
> 

Why do it in a simple way when there is an opportunity to (ab)use perl?

Mladen Gogala
Oracle DBA



Note:
This message is for the named person's use only.  It may contain confidential, 
proprietary or legally privileged information.  No confidentiality or privilege is 
waived or lost by any mistransmission.  If you receive this message in error, please 
immediately delete it and all copies of it from your system, destroy any hard copies 
of it and notify the sender.  You must not, directly or indirectly, use, disclose, 
distribute, print, or copy any part of this message if you are not the intended 
recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to 
monitor all e-mail communications through its networks.
Any views expressed in this message are those of the individual sender, except where 
the message states otherwise and the sender is authorized to state them to be the 
views of any such entity.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Mladen Gogala
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Re: UNIX OT: exclude files in tar

2003-11-25 Thread Mladen Gogala
Then I'll pipe it to cpio -H tar, which will solve the problem.
On 11/25/2003 01:24:26 PM, Tanel Poder wrote:
> This approach might cause problems, if you have really lots of files -> your
> shell argument buffer (or whatever is the correct name for it) becomes full
> 
> Tanel.
> 
> - Original Message - 
> To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]>
> Sent: Tuesday, November 25, 2003 4:54 PM
> 
> 
> > I never rely on tar to do that. Here is the trick that I use when I want
> to be selective:
> >
> >  tar zcvf /tmp/test1.tgz `perl -e 'foreach (<*.pl>) { if (/connect/)
> {print "$_\n";}}'`
> >
> > Basically, you write a small perl script which will output only the files
> > you want and hand that to tar. Works each and every time. That is
> precisely
> > why Unix is such a great OS and Slowaris definitely is Unix, unless SCO
> > has revoked the license.
> >
> > On 11/25/2003 12:24:26 AM, Ross Collado wrote:
> > > Hello,
> > >
> > > On Solaris 8
> > >
> > > I can't seem to get the tar command right.  I wanted to tar a directory
> but
> > > EXCLUDE one of the subdirectory in it.
> > > Example:
> > > /home/user01
> > > /home/user01/mark01
> > > /home/user01/mark01/ask.txt
> > > /home/user01/mark01/ghost.txt
> > > /home/user01/mark02
> > > /home/user01/mark02/ask.txt
> > > /home/user01/mark02/ghost.txt
> > > /home/user01/mark03
> > > /home/user01/mark03/ask.txt
> > > /home/user01/mark03/ghost.txt
> > >
> > > I wanted to tar everything except /home/user01/mark03/*
> > > man pages on tar says there is an option to exclude files but I just
> can't
> > > get it to work for me.
> > >
> > > Can someone show me how to do this right?
> > >
> > > Thanks,
> > > Ross
> > > -- 
> > > Please see the official ORACLE-L FAQ: http://www.orafaq.net
> > > -- 
> > > Author: Ross Collado
> > >   INET: [EMAIL PROTECTED]
> > >
> > > Fat City Network Services-- 858-538-5051 http://www.fatcity.com
> > > San Diego, California-- Mailing list and web hosting services
> > > -
> > > To REMOVE yourself from this mailing list, send an E-Mail message
> > > to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> > > the message BODY, include a line containing: UNSUB ORACLE-L
> > > (or the name of mailing list you want to be removed from).  You may
> > > also send the HELP command for other information (like subscribing).
> > >
> >
> > Mladen Gogala
> > Oracle DBA
> >
> >
> >
> > Note:
> > This message is for the named person's use only.  It may contain
> confidential, proprietary or legally privileged information.  No
> confidentiality or privilege is waived or lost by any mistransmission.  If
> you receive this message in error, please immediately delete it and all
> copies of it from your system, destroy any hard copies of it and notify the
> sender.  You must not, directly or indirectly, use, disclose, distribute,
> print, or copy any part of this message if you are not the intended
> recipient. Wang Trading LLC and any of its subsidiaries each reserve the
> right to monitor all e-mail communications through its networks.
> > Any views expressed in this message are those of the individual sender,
> except where the message states otherwise and the sender is authorized to
> state them to be the views of any such entity.
> >
> > -- 
> > Please see the official ORACLE-L FAQ: http://www.orafaq.net
> > -- 
> > Author: Mladen Gogala
> >   INET: [EMAIL PROTECTED]
> >
> > Fat City Network Services-- 858-538-5051 http://www.fatcity.com
> > San Diego, California-- Mailing list and web hosting services
> > -
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from).  You may
> > also send the HELP command for other information (like subscribing).
> >
> 
> 
> -- 
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> -- 
> Author: Tanel Poder
>   INET: [EMAIL PROTECTED]
> 
> Fat City Network Services-- 858-538-5051 http://www.fatcity.com
> San Diego, California-- Mailing list and web hosting services
> -
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).
> 

Mladen Gogala
Oracle DBA



Note:
This message is for the named person's use only.  It may contain confidential, 
proprietary or legally privileged information.  No confidentiality or privilege is 
waived or lost by any mistransmissio

Re: UNIX OT: exclude files in tar

2003-11-25 Thread Tanel Poder
This approach might cause problems, if you have really lots of files -> your
shell argument buffer (or whatever is the correct name for it) becomes full

Tanel.

- Original Message - 
To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]>
Sent: Tuesday, November 25, 2003 4:54 PM


> I never rely on tar to do that. Here is the trick that I use when I want
to be selective:
>
>  tar zcvf /tmp/test1.tgz `perl -e 'foreach (<*.pl>) { if (/connect/)
{print "$_\n";}}'`
>
> Basically, you write a small perl script which will output only the files
> you want and hand that to tar. Works each and every time. That is
precisely
> why Unix is such a great OS and Slowaris definitely is Unix, unless SCO
> has revoked the license.
>
> On 11/25/2003 12:24:26 AM, Ross Collado wrote:
> > Hello,
> >
> > On Solaris 8
> >
> > I can't seem to get the tar command right.  I wanted to tar a directory
but
> > EXCLUDE one of the subdirectory in it.
> > Example:
> > /home/user01
> > /home/user01/mark01
> > /home/user01/mark01/ask.txt
> > /home/user01/mark01/ghost.txt
> > /home/user01/mark02
> > /home/user01/mark02/ask.txt
> > /home/user01/mark02/ghost.txt
> > /home/user01/mark03
> > /home/user01/mark03/ask.txt
> > /home/user01/mark03/ghost.txt
> >
> > I wanted to tar everything except /home/user01/mark03/*
> > man pages on tar says there is an option to exclude files but I just
can't
> > get it to work for me.
> >
> > Can someone show me how to do this right?
> >
> > Thanks,
> > Ross
> > -- 
> > Please see the official ORACLE-L FAQ: http://www.orafaq.net
> > -- 
> > Author: Ross Collado
> >   INET: [EMAIL PROTECTED]
> >
> > Fat City Network Services-- 858-538-5051 http://www.fatcity.com
> > San Diego, California-- Mailing list and web hosting services
> > -
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from).  You may
> > also send the HELP command for other information (like subscribing).
> >
>
> Mladen Gogala
> Oracle DBA
>
>
>
> Note:
> This message is for the named person's use only.  It may contain
confidential, proprietary or legally privileged information.  No
confidentiality or privilege is waived or lost by any mistransmission.  If
you receive this message in error, please immediately delete it and all
copies of it from your system, destroy any hard copies of it and notify the
sender.  You must not, directly or indirectly, use, disclose, distribute,
print, or copy any part of this message if you are not the intended
recipient. Wang Trading LLC and any of its subsidiaries each reserve the
right to monitor all e-mail communications through its networks.
> Any views expressed in this message are those of the individual sender,
except where the message states otherwise and the sender is authorized to
state them to be the views of any such entity.
>
> -- 
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> -- 
> Author: Mladen Gogala
>   INET: [EMAIL PROTECTED]
>
> Fat City Network Services-- 858-538-5051 http://www.fatcity.com
> San Diego, California-- Mailing list and web hosting services
> -
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).
>


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Tanel Poder
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


RE: UNIX OT: exclude files in tar

2003-11-25 Thread Robertson Lee - lerobe
You can use the -L option and have a file listing everything you want

ie, ls > file
edit file and remove the dir you don't want

tar files with the -L option and the file you created above.

never done this myself



-Original Message-
[EMAIL PROTECTED]
Sent: 25 November 2003 16:44
To: Multiple recipients of list ORACLE-L



Maybe can use -prune option of find to send file list to tar:

cd /home
find ./user01 -name mark03 -prune -o -print

> -Original Message-
> > 
> > I can't seem to get the tar command right.  I wanted to tar 
> a directory but
> > EXCLUDE one of the subdirectory in it.
> > Example:
> > /home/user01
> > /home/user01/mark01
> > /home/user01/mark01/ask.txt
> > /home/user01/mark01/ghost.txt
> > /home/user01/mark02
> > /home/user01/mark02/ask.txt
> > /home/user01/mark02/ghost.txt
> > /home/user01/mark03
> > /home/user01/mark03/ask.txt
> > /home/user01/mark03/ghost.txt
> > 
> > I wanted to tar everything except /home/user01/mark03/*
> > man pages on tar says there is an option to exclude files 
> but I just can't
> > get it to work for me. 
> > 
> > Can someone show me how to do this right?
> > 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: <[EMAIL PROTECTED]
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




**
The information contained in this communication is
confidential, is intended only for the use of the recipient
named above, and may be legally privileged.
If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, 
distribution, or copying of this communication is strictly
prohibited.
If you have received this communication in error,
please re-send this communication to the sender and
delete the original message or any copy of it from your
computer system. Thank You.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Robertson Lee - lerobe
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


RE: UNIX OT: exclude files in tar

2003-11-25 Thread Stephen.Lee

Maybe can use -prune option of find to send file list to tar:

cd /home
find ./user01 -name mark03 -prune -o -print

> -Original Message-
> > 
> > I can't seem to get the tar command right.  I wanted to tar 
> a directory but
> > EXCLUDE one of the subdirectory in it.
> > Example:
> > /home/user01
> > /home/user01/mark01
> > /home/user01/mark01/ask.txt
> > /home/user01/mark01/ghost.txt
> > /home/user01/mark02
> > /home/user01/mark02/ask.txt
> > /home/user01/mark02/ghost.txt
> > /home/user01/mark03
> > /home/user01/mark03/ask.txt
> > /home/user01/mark03/ghost.txt
> > 
> > I wanted to tar everything except /home/user01/mark03/*
> > man pages on tar says there is an option to exclude files 
> but I just can't
> > get it to work for me. 
> > 
> > Can someone show me how to do this right?
> > 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: <[EMAIL PROTECTED]
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Re: UNIX OT: exclude files in tar

2003-11-25 Thread Mladen Gogala
tar cvf /tmp/test1.tar `perl -e 'foreach 
On 11/25/2003 12:24:26 AM, Ross Collado wrote:
> Hello,
> 
> On Solaris 8
> 
> I can't seem to get the tar command right.  I wanted to tar a directory but
> EXCLUDE one of the subdirectory in it.
> Example:
> /home/user01
> /home/user01/mark01
> /home/user01/mark01/ask.txt
> /home/user01/mark01/ghost.txt
> /home/user01/mark02
> /home/user01/mark02/ask.txt
> /home/user01/mark02/ghost.txt
> /home/user01/mark03
> /home/user01/mark03/ask.txt
> /home/user01/mark03/ghost.txt
> 
Here is how to do it:
Create script called /tmp/tmp1.pl containing the following:

#!/usr/bin/perl
open FL,"find /home -print|"||die "Cannot open file:$!\n";
$pattern="\/mark03\/";
while () {
  chomp;
  if (/$pattern/) { next; }
  print "$_\n";
}

Purists will cringe when seeing a script without "use strict" and executing "find"
but it's short and it works.

Next, you chmod /tmp/tmp1.pl to 700 and do tar cvf /mydir/myfile.tar `/tmp/tmp1.pl`

It works each and every time.
Mladen Gogala
Oracle DBA



Note:
This message is for the named person's use only.  It may contain confidential, 
proprietary or legally privileged information.  No confidentiality or privilege is 
waived or lost by any mistransmission.  If you receive this message in error, please 
immediately delete it and all copies of it from your system, destroy any hard copies 
of it and notify the sender.  You must not, directly or indirectly, use, disclose, 
distribute, print, or copy any part of this message if you are not the intended 
recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to 
monitor all e-mail communications through its networks.
Any views expressed in this message are those of the individual sender, except where 
the message states otherwise and the sender is authorized to state them to be the 
views of any such entity.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Mladen Gogala
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Re: UNIX OT: exclude files in tar

2003-11-25 Thread Mladen Gogala
I never rely on tar to do that. Here is the trick that I use when I want to be 
selective:

 tar zcvf /tmp/test1.tgz `perl -e 'foreach (<*.pl>) { if (/connect/) {print "$_\n";}}'`

Basically, you write a small perl script which will output only the files
you want and hand that to tar. Works each and every time. That is precisely
why Unix is such a great OS and Slowaris definitely is Unix, unless SCO 
has revoked the license.

On 11/25/2003 12:24:26 AM, Ross Collado wrote:
> Hello,
> 
> On Solaris 8
> 
> I can't seem to get the tar command right.  I wanted to tar a directory but
> EXCLUDE one of the subdirectory in it.
> Example:
> /home/user01
> /home/user01/mark01
> /home/user01/mark01/ask.txt
> /home/user01/mark01/ghost.txt
> /home/user01/mark02
> /home/user01/mark02/ask.txt
> /home/user01/mark02/ghost.txt
> /home/user01/mark03
> /home/user01/mark03/ask.txt
> /home/user01/mark03/ghost.txt
> 
> I wanted to tar everything except /home/user01/mark03/*
> man pages on tar says there is an option to exclude files but I just can't
> get it to work for me. 
> 
> Can someone show me how to do this right?
> 
> Thanks,
> Ross
> -- 
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> -- 
> Author: Ross Collado
>   INET: [EMAIL PROTECTED]
> 
> Fat City Network Services-- 858-538-5051 http://www.fatcity.com
> San Diego, California-- Mailing list and web hosting services
> -
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).
> 

Mladen Gogala
Oracle DBA



Note:
This message is for the named person's use only.  It may contain confidential, 
proprietary or legally privileged information.  No confidentiality or privilege is 
waived or lost by any mistransmission.  If you receive this message in error, please 
immediately delete it and all copies of it from your system, destroy any hard copies 
of it and notify the sender.  You must not, directly or indirectly, use, disclose, 
distribute, print, or copy any part of this message if you are not the intended 
recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to 
monitor all e-mail communications through its networks.
Any views expressed in this message are those of the individual sender, except where 
the message states otherwise and the sender is authorized to state them to be the 
views of any such entity.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Mladen Gogala
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Re: UNIX OT: exclude files in tar

2003-11-25 Thread Michael Boligan




It doesn't use the exclude, but it would do what you want:

cd /home/user01
tar -cvf /dev/rmt0 mark01 mark02

where /dev/rmt0 is your tape device, or you can substitute a disk destination.

HTH,
Mike


   
  
  Ross Collado 
  
  <[EMAIL PROTECTED]To:   Multiple recipients of list 
ORACLE-L <[EMAIL PROTECTED]> 
  hpac.com>cc: 
  
  Sent by: Subject:  UNIX OT: exclude files in tar 
  
  [EMAIL PROTECTED]
  
  .com 
  
   
  
   
  
  11/25/2003 12:24 
  
  AM   
  
  Please respond to
  
  ORACLE-L 
  
   
  
   
  




Hello,

On Solaris 8

I can't seem to get the tar command right.  I wanted to tar a directory but
EXCLUDE one of the subdirectory in it.
Example:
/home/user01
/home/user01/mark01
/home/user01/mark01/ask.txt
/home/user01/mark01/ghost.txt
/home/user01/mark02
/home/user01/mark02/ask.txt
/home/user01/mark02/ghost.txt
/home/user01/mark03
/home/user01/mark03/ask.txt
/home/user01/mark03/ghost.txt

I wanted to tar everything except /home/user01/mark03/*
man pages on tar says there is an option to exclude files but I just can't
get it to work for me.

Can someone show me how to do this right?

Thanks,
Ross
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Ross Collado
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Michael Boligan
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Re: UNIX OT: exclude files in tar

2003-11-24 Thread Brian_P_MacLean

Just another excuse to read the tar man page.  This series of commands
seamed to work in testing.  Note the "excluded" and "OK" on the tar command
output.  As the tar man page states, be careful on the leading and trailing
spaces in the exclude file. As with most Unix commands,  DON'T use a "-" in
the exclude file name, doing so will lead you to question your own sanity
when things just don't seam to work right.

mkdir -p level.1/level.2.1/level.2.1.1 \
 level.1/level.2.1/level.2.1.2 \
 level.1/level.2.2/level.2.2.1 \
 level.1/level.2.3/level.2.3.1
touch level.1/level.2.1/level.2.1.1/yes.level.2.1.1 \
  level.1/level.2.1/level.2.1.2/no.level.2.1.1  \
  level.1/level.2.2/yes.2.2.1   \
  level.1/level.2.2/level.2.2.1/no.2.2.1\
  level.1/level.2.3/level.2.3.1/yes.2.3.1
echo "level.1/level.2.1/level.2.1.2"  >exclude.file
echo "level.1/level.2.2/level.2.2.1" >>exclude.file
tar -cvfX myfiles.tar exclude.file level.1
tar -tvf myfiles.tar
find . -name '*' -type f
ls -Fla
uname -a


24956:[EMAIL PROTECTED]> tar -cvfX myfiles.tar exclude.file level.1
a level.1/ 0K
a level.1/level.2.1/ 0K
a level.1/level.2.1/level.2.1.1/ 0K
a level.1/level.2.1/level.2.1.1/yes.level.2.1.1 0K
a level.1/level.2.1/level.2.1.2 excluded
a level.1/level.2.2/ 0K
a level.1/level.2.2/level.2.2.1 excluded
a level.1/level.2.2/yes.2.2.1 0K
a level.1/level.2.3/ 0K
a level.1/level.2.3/level.2.3.1/ 0K
a level.1/level.2.3/level.2.3.1/yes.2.3.1 0K

24956:[EMAIL PROTECTED]> tar -tvf myfiles.tar
tar: blocksize = 11
drwxr-xr-x 101/2000  0 Nov 24 22:46 2003 level.1/
drwxr-xr-x 101/2000  0 Nov 24 22:46 2003 level.1/level.2.1/
drwxr-xr-x 101/2000  0 Nov 24 22:46 2003 level.1/level.2.1/level.2.1.1/
-rw-r--r-- 101/2000  0 Nov 24 22:46 2003
level.1/level.2.1/level.2.1.1/yes.level.2.1.1
drwxr-xr-x 101/2000  0 Nov 24 22:46 2003 level.1/level.2.2/
-rw-r--r-- 101/2000  0 Nov 24 22:46 2003 level.1/level.2.2/yes.2.2.1
drwxr-xr-x 101/2000  0 Nov 24 22:46 2003 level.1/level.2.3/
drwxr-xr-x 101/2000  0 Nov 24 22:46 2003 level.1/level.2.3/level.2.3.1/
-rw-r--r-- 101/2000  0 Nov 24 22:46 2003
level.1/level.2.3/level.2.3.1/yes.2.3.1

24956:[EMAIL PROTECTED]> find . -name '*' -type f
./level.1/level.2.1/level.2.1.1/yes.level.2.1.1
./level.1/level.2.1/level.2.1.2/no.level.2.1.1
./level.1/level.2.2/level.2.2.1/no.2.2.1
./level.1/level.2.2/yes.2.2.1
./level.1/level.2.3/level.2.3.1/yes.2.3.1
./myfiles.tar
./exclude.file

24956:[EMAIL PROTECTED]> ls -Fla
total 80
drwxr-xr-x   3 oracle   dba  318 Nov 24 22:52 ./
drwxrwxrwt  13 root sys 8057 Nov 24 22:59 ../
-rw-r--r--   1 oracle   dba   60 Nov 24 22:46 exclude.file
drwxr-xr-x   5 oracle   dba  315 Nov 24 22:46 level.1/
-rw-r--r--   1 oracle   dba 5632 Nov 24 22:53 myfiles.tar

24956:[EMAIL PROTECTED]> uname -a
SunOS bigkahuna 5.8 Generic_108528-22 sun4u sparc SUNW,Ultra-Enterprise



   
   
  Ross Collado 
   
  <[EMAIL PROTECTED]To:   Multiple recipients of list 
ORACLE-L <[EMAIL PROTECTED]>  
  hpac.com>cc: 
   
  Sent by: Subject:  UNIX OT: exclude files in tar 
   
  [EMAIL PROTECTED]
   
  .com 
   
   
   
   
   
  11/24/2003 10:24 
   
  PM   
   
  Please respond to
   
  ORACLE-L 
   
   
   
   
   




Hello,

On Solaris 8

I can't seem to get the tar command right.  I wanted to tar a directory but
EXCLUDE one of the subdirectory in it.
Example:
/home/user01
/home/user01/mark01
/