Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Need script that monitors for archive directory filling up
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
![]() |
![]() |