The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Q: tar archive help nookie UNIX for Dummies Questions & Answers 1 09-03-2007 10:30 AM
Updating a File in a Zip Archive dbridle AIX 6 09-27-2006 03:29 PM
Archive script old files kayarsenal Shell Programming and Scripting 1 08-25-2006 01:46 AM
Archive files kayarsenal Shell Programming and Scripting 13 08-21-2006 11:01 AM
tar archive with .Z files Kun2112 UNIX for Dummies Questions & Answers 3 08-05-2005 09:42 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-19-2006
dreams5617 dreams5617 is offline
Registered User
  
 

Join Date: Jul 2004
Location: USA
Posts: 52
Arrow Archive (tar)

Hi,

I want to archive below directories
ex: /home/oracle/ddd0
/home/oracle/ddd1
/home/oracle/ddd2

I want a command(tar) which will let me archive the above directories excluding *.dmp(dump files), *.log(log files) in those directories.

So the archived file doesn't have *.dmp(dump files), *.log(log files) in it.

thanks
  #2 (permalink)  
Old 10-19-2006
grial's Avatar
grial grial is offline Forum Advisor  
El UNIX es como un toro
  
 

Join Date: Jun 2006
Location: Madrid (Spain)
Posts: 531
Helo.
Depending on your tar version, there's an option which allows you that. For instance, Solaris 9 tar man page says:
Code:
 X     Exclude. Use the exclude-file argument as a file  con-
           taining  a  list  of relative path names for files (or
           directories) to be  excluded  from  the  tarfile  when
           using the functions c, x, or t. Be careful of trailing
           white spaces. Also beware  of  leading  white  spaces,
           since,  for each line in the excluded file, the entire
           line (apart from the newline) will be  used  to  match
           against the initial string of files to exclude. Multi-
           ple X arguments may be used, with one exclude-file per
           argument.  In  the  case  where included files (see -I
           include-file option) are also specified, the  excluded
           files  take  precedence  over all included files. If a
           file is specified in both  the  exclude-file  and  the
           include-file  (or  on  the  command  line), it will be
           excluded.
Anyway, you could do something like:
Code:
touch /tmp/bck.tar && find /home/oracle/ddd[12] ! -name "*log" ! -name "*dmp" -type f -exec tar uvf /tmp/bck.tar {} \;

Regards.
  #3 (permalink)  
Old 10-19-2006
dreams5617 dreams5617 is offline
Registered User
  
 

Join Date: Jul 2004
Location: USA
Posts: 52
Exclamation Archive (tar)

Hi,

I want to archive below directory
ex: /home/oracle/dd0
sub-directories in dd0
/home/oracle/dd0/backup/backup1
/home/oracle/dd0/backup/backup2
/home/oracle/dd0/dmp
....etc

I want a command(tar) which will let me archive the above directory excluding *.dmp(dump files), *.log(log files) in that directory & in the sub-directories also.

So the archived file doesn't have *.dmp(dump files), *.log(log files) in it.

Pls reply ASAP.

The below reply for this post ignores the sub-directories.

thanks
  #4 (permalink)  
Old 10-20-2006
grial's Avatar
grial grial is offline Forum Advisor  
El UNIX es como un toro
  
 

Join Date: Jun 2006
Location: Madrid (Spain)
Posts: 531
Have you tried the "X" tar option? Read your tar man page for more info...
  #5 (permalink)  
Old 03-29-2007
get_chandrakant get_chandrakant is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 8
Hey Tell me how can we use Tar's "X" i.e. exclude option give me a example of command which can runs on SunOS and /bin/sh shell.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0