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

Home -> Community -> Mailing Lists -> Oracle-L -> Need script that monitors for archive directory filling up

Need script that monitors for archive directory filling up

From: Carle, William T (Bill), NBSO <wcarle_at_att.com>
Date: Thu, 14 Dec 2000 08:36:30 -0600
Message-Id: <10710.124565@fatcity.com>


Hi,

    Here is a script that monitors the archive directory (/ora_cf2) and copies the archive logs to a backup directory (/ora_bu3) when the archive directory gets to be a certain percentage full. We use 70%. It also compresses the files. It then e-mails me to let me know that this has been done. All you need to do is pass the percentage into the script as a parameter.

Bill Carle
AT&T
Database Administrator
816-995-3922
wcarle_at_att.com

# This shell script moves *.ARC files from /ora_cf2 to /ora_bu3 and #
compresses them.
# It is designed to be run when ora_cf2 hits a predefined percent full
#
# Version 1.0 09/15/98 ews

ARCH_VOL=/ora_bu2
export ARCH_VOL
USAGE="$0: $0 [ nn ] where nn is a percentage filesytem full" NODE='uname -n'
if test $# -gt 0
then
TEST_PCT=$1
PCT='bdf|grep /ora_cf2|tr '%' ' '|awk ' { print $5 }'' if test "${PCT}" -lt "${TEST_PCT}"
then
echo "$0 $PCT not greater than $TEST_PCT " exit
fi mailx -s "$NODE: /ora_cf2 > $TEST_PCT" wcarle_at_att.com <<-EOF $0: /ora_cf2 is at $PCT archiving *.ARC to $ARCH_VOL and compressing. EOF
fi
cd /ora_cf2
for FLE in 'ls *.ARC'
do
# cp $FLE ${ARCH_VOL}/$FLE

	rm $FLE

# compress ${ARCH_VOL}/$FLE

done
chown oracle:dba ${ARCH_VOL}/*.Z Received on Thu Dec 14 2000 - 08:36:30 CST

Original text of this message

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