Python script to send email about full disks
Assumptions:
The script is meant to be installed in any user's bin directory, or wherever it can be run from cron. It needs no special privileges.
This is helpful for being proactive about filesystems filling up. Nightly monitoring and alerting can help prevent disruptions. If using LVM, it's easy to respond to almost-full disks:
# umount /dev/foo/bar # e2fsk -fy /dev/foo/bar # lvextend -L ??? foo/bar # resize2fs /dev/foo/bar # mount /dev/foo/bar