The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-25-2008
adzuanamir adzuanamir is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 40
script to monitor partition cant execute

Hi...
I'm trying to run this script by using cronjob but it doesnt work. The purpose of this script is to monitor my oracle database partition when the size is less than 1gb, the script will trigger an email to my email address to alert about partition size
-------------------------------------------------------------------------
check_filesystem_size.ksh
-------------------------------------------------------------------------
#!/bin/ksh

for i in `df -k|grep /u0|awk '{ print $4 }'`
do
# Convert the file size to a numeric value
filesize=`expr i`

# If any filesystem has less than 1000k, issue an alert
if [ $filesize -lt 1000 ]
then
mailx -s "Oracle filesystem $i has less than 1000k free."\
adzuan@nc.com.my
fi
done
----------------------------------------------------------------------

Crontab line:

0 0 * * * /ek_ora/script/check_filesystem_size.ksh > dev/null >&1

----------------------------------------------------------------------

The error from /var/mail/oracle

Your "cron" job on jupm-wp11
/ek_ora/script/check_oracle_filesystem.ksh > /dev/null >&1

produced the following output:

sh: /ek_ora/script/check_oracle_filesystem.ksh: not found
-----------------------------------------------------------------------

Can anybody tell me why the script doesnt work??

Last edited by adzuanamir; 06-25-2008 at 01:43 AM..