Isso deve ajudá-lo:
#!/bin/sh
MOUNTPOINTS="/ /home"
THRESHOLD=90
for MOUNT in ${MOUNTPOINTS}; do
CURRENT=$(df ${MOUNT} | grep / | awk '{ print $5}' | sed 's/%//g')
if [ "${CURRENT}" -gt "${THRESHOLD}" ] ; then
mail -s 'Disk Space Alert' root << EOF
Your ${MOUNT} partition remaining free space is critically low. Used: ${CURRENT}%
EOF
fi
done
Isto é baseado fora do código por Malik Arjun .