The more I play with your script, the more fun it becomes.

# 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 comparison will
grep -v Capacity |
# There's no need to check the /proc filesystem, it'll always be full,
grep -v /proc | 
awk '{print$5}' | 
# You have to use sed to eliminate the % from df -k or the comparison
will fail.
sed -e 's/%//' > drvspc.txt 
cat drvspc.txt | 
while read i
        if [ $i -gt 89 ] ; then
        mail -s "check drive space on core" [EMAIL PROTECTED]
# Quotes not necessary when echoing a single word, but I wouldn't do
this, you
# might want to schedule this with cron and it'll clutter up your screen
# if you tell it to say 'done' every time it runs.
echo done 
exit 0


Got a computer with idle CPU time?
Join [EMAIL PROTECTED] and help make history!

[EMAIL PROTECTED] mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to