/ 領域のディスクの容量を監視するスクリプトです。
#!/bin/sh email={address} Subject="NG DiskSpaceUsage" if [ "$1" != "" ]; then email=$1 fi DVAL=`/bin/df / | /usr/bin/tail -1 | /bin/sed 's/^.* \([0-9]*\)%.*$/\1/'` if [ $DVAL -gt 80 ]; then ( cat << EOF DiskSpaceUsage $DVAL please check df -h du -sh /path/to/dirctory/* EOF ) | /bin/mail -s "$Subject" ${email} fi