All pastes #88001 Raw Edit

Espao em disco

public text v1 · immutable
·published 2006-07-14 12:14 UTC
rendered paste body
#!/bin/sh

df -H | grep -vE '^Sist|File' | awk '{ print $5 " " $1 }' | while read output;
do
        echo $output
        size=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
        particao=$(echo $output | awk '{ print $2 }' )
        if [ $size -ge 50 ]; then
                echo "Running out of space \"$particao ($size%)\" on $(hostname) as on $(date)" |
                mail -s "Alerta: Almost out of disk space $size%" seu@email.com
        fi
done