Categories
Unix Notes

Because I can

This is actually all one line


ZX=`eval df | awk 'split($5, ZZZ, /%/) && //dev// && ZZZ[1] > 5 {printf("%s (%s) %s%%n",$6, $1,ZZZ[1])}' `; test "${ZX}" && echo $ZX | mail -s "Disk Low" foo@carpediem.com

1 liner to mail if disk space exceeds 5% on any real volume

One reply on “Because I can”