cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for a ksh (or csh) script to check file system size.

Former Member
0 Kudos

I'm looking for a UNIX script that is probably very common. I'm not a great UNIX script programmer.

The script I'm looking for would to the following and be runned in crontab:

If the saparch (or oraarch) directory is greater than 70% then send an email

Any advice on how to get such a common script?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

stefan_koehler
Active Contributor
0 Kudos

Hello Bill,

why not using CCMS for that?

Regards

Stefan

Former Member
0 Kudos

Because it was requested to be in a cronjob.

stefan_koehler
Active Contributor
0 Kudos

Hello Bill,

sometimes i am wondering what the requester thought .. but ok ..

The shell script is not very complex .. but the output of the "df" commands differs on the various unix operating systems.

So we need a sample output of the "df <FOLDER>.

Regards

Stefan

Former Member
0 Kudos

Here is the begiining of the df -g command on the AIX 6.1 O/S

$ df -g

Filesystem GB blocks Free %Used Iused %Iused Mounted on

/dev/hd4 1.00 0.76 24% 12625 7% /

/dev/hd2 4.00 2.05 49% 43817 9% /usr

/dev/hd9var 2.00 1.12 44% 7462 3% /var

/dev/hd3 1.00 0.88 13% 171 1% /tmp

/dev/hd1 1.00 0.64 36% 953 1% /home

/dev/hd11admin 1.00 0.99 1% 13 1% /admin

ImtiazKaredia
Active Contributor
0 Kudos

you can use this as base if you are on HPUX system

********************************

#!/usr/bin/ksh

SID=<YOUR System SID>

while true

do

ARCH=`bdf /oracle/$SID/oraarch | awk '/2/{ if (( $5 * 1 ) > 70) print "TRUE"}'`

if [ "$ARCH" ]; then

mail -s "Archive is above 70%" email@email

echo email sent `date`

fi

sleep 60

done

****************************

Edited by: Imtiaz.Karedia on Jan 28, 2010 12:19 PM

Former Member
0 Kudos

Thanks!

Answers (0)