nicole said:

> > 3) Any tools out there to keep an eye on my disk space situation for me?

it looks like henry beat me to the punch with your other questions, and
ricardo gave you an option for question 3.   let me give an alternative.

use the following script as a cron job.  it's a good way to show off bash's
array and arithmetic capabilities.

pete

ps- not really tested, so ymmv.   i think this is alright, though.

###################################################################
# emails someone when a partition gets tight.                     #
###################################################################
#!/bin/sh

partition=(` df | awk '{print $1}' | grep -v 'Filesystem'`)
use=(`df | awk '{print $5}' | grep -v 'Use' | sed 's/\%$//g'`)
bigcheese='root@localhost'


i=0
while [ $i -lt ${#use[@]} ]; do
        if [ ${use[$i]} -gt 50 ]; then
                mail -s "low partition: ${partition[$i]}" ${bigcheese} <<-EOF
                        To the batcave, robin!
                        EOF
        fi
        let i=($i + 1)
done


Reply via email to