Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Need script to copy and then truncate/tail alert log

Re: Need script to copy and then truncate/tail alert log

From: Ernest Simard <simard_at_sonoma.edu>
Date: Wed, 26 Jul 2000 08:55:01 -0500
Message-Id: <10570.113022@fatcity.com>


Hi,
I use a slightly different approach. Append the day to the log files, this will overwrite the previous weeks file, always leaving you a weeks worth of logs (Korn shell/Solaris). The script is run by crontab just before midnight.

Ernest Simard
System Analyst
Sonoma State Univ
707-664-3091

#!/bin/ksh
TODAY=$(date)
THIS_DAY=$(date +%a)
DIR=/u01/app/oracle

mv -f $DIR/admin/ADM/bdump/alert_ADM.log
$DIR/admin/ADM/bdump/alert_ADM.log_$THIS_DAY
mv -f $DIR/product/8.0.6/network/log/dbsnmpc.log
$DIR/product/8.0.6/network/log/dbsnmpc.log_$THIS_DAY
mv -f $DIR/product/8.0.6/network/log/dbsnmpw.log
$DIR/product/8.0.6/network/log/dbsnmpw.log_$THIS_DAY
mv -f $DIR/product/8.0.6/network/log/listener.log $DIR/product/8.0.6/network/log/listener.log_$THIS_DAY

> Does anyone have a script that will copy over and then truncate or tail (I
can't
> remember if it's tail)
> the alert log? Or something appropriate to keep our alert log to a day's
worth
> of log information while
> keeping the file in the same directory (hopefully with a datestamp in the
old
> log file name). Then we
> want to clean out the old log files on a weekly or daily basis.
>
> Thanks in advance for any help.
>
> Cherie
>
>
> --
> Author:
> INET: Cherie_Machler_at_gelco.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (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).
Received on Wed Jul 26 2000 - 08:55:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US