Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Sep 2003 13:54:55 -0400 (EDT)
From:      "Brent Bailey" <mrb@bmyster.com>
To:        questions@freebsd.org
Subject:   drive space shell script help ?
Message-ID:  <54020.207.5.142.198.1063648495.squirrel@bmyster.com>

next in thread | raw e-mail | index | archive | help
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@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@bmyster.com
207-247-8330





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54020.207.5.142.198.1063648495.squirrel>