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}'
#!/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
This line should be:
if [ $i -gt 89 ] ; then
The spaces between
The more I play with your script, the more fun it becomes.
#!/bin/sh
# this is a script to check drive space and email HSD dept.
#
cd ~bbailey
rm drvspc.txt # Once I'm in ~bbailey, I don't need the complete path to
any files there.
df -k |
# You have to get rid of the word 'Capacity' or your
Awesome that worked ..Im also going to try some of the other options you
had mentioned..I wanted to thank you for your help :-)
This has got to be the best dam mailing list there is :-)
--
Brent Bailey CCNA
Bmyster LLC
Computer Networking and Webhosting
Network Engineer, Webmaster, President