Monitor partition size on Debian
How can I monitor my /backups partition on my Debian-Lenny box?
I have sendmail and I would like to receive an email when my partition gets over, for instance, 80% of its total size.
Solution 1:
Write simple script that sends e-mail if space usage gets over 80% and add it to crontab. On FreeBSD crond
sends an e-mails with output of each called program, probably on Debian it does the same. If not - use any CLI e-mail client, mail(1) for example.
Example of script that checks space usage and prints warning if it is more that 80%:
df /backups | awk 'NR==2 {sub("%","",$5); if ($5 >= 80) {printf "Warning! Space usage is %d%%\n", $5}}'