#!/bin/sh
LIMIT=2
PARTITION=/dev/sda3

avail=$(df -h --output='avail' ${PARTITION} | tail -n1 | sed 's/^ *\([0-9]\+\),.*/\1/')
if [ $avail -lt $LIMIT ] ; then
  # echo "To less space (<${LIMIT}GB) on ${PARTITION}"
  mailx -s "To less space (<${LIMIT}GB) on ${PARTITION}" andreas@an3as.eu < /dev/null >/dev/null
fi
