The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



Thread: Archive (tar)
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 10-19-2006
grial's Avatar
grial grial is offline
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.
Reply With Quote