-----Original Message-----
Within script how do I skip archived log file that is being written by
oracle?
-----------------------------------------------------

I took another look at this and figured out what you were really asking.
The commands: "ls -1rt" or "ls -1t" will list the files in the directory and
sort according to time.  Note that the "1" is a one.  This will allow you to
see the most recent files.  If you would like to keep the two most recent
then something like:

#!/bin/ksh

COUNT=0
for i in `ls -1t *.dbf`; do
   COUNT=$(( $COUNT + 1 ))
   if [ $COUNT -gt 2 ]; then
      SEND $i TO TAPE
      if [ $? -ne 0 ]; then
         print "SOMETHING BROKE"
      else
         rm $i
         (or maybe safer to move it to a pre-delete filesystem, then delete
it later)
      fi
   fi
done
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Stephen Lee
  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).

Reply via email to