drive space shell script help ?

Brent Bailey mrb at bmyster.com
Mon Sep 15 10:50:04 PDT 2003


Im trying to write  a script that will email me when drive space on any
given partition is above a certain value.

i was trying this ...but no working ...

#!/bin/sh
# this is a script to check drive space and email HSD dept.
#
cd ~bbailey
rm ~bbailey/drvspc.txt
df -k  | awk '{print$5}' >~bbailey/drvspc.txt
cat drvspc.txt
while read i
do
        if [$i > '89'];  then
        mail -s "check drive space on core" bbailey at whatever.com
fi
echo "done"

ME not being that great at shell scripting yet ...i was wondering what im
doing wrong here ??

any and all help is greatly appreciated

thanx
-- 
Brent Bailey CCNA
Bmyster LLC
Computer Networking and Webhosting
Network Engineer, Webmaster, President
http://www.bmyster.com
mrb at bmyster.com
207-247-8330





More information about the freebsd-questions mailing list