邮箱超出配额小脚本 内容如下 #!/bin/bash cd /home/test postqueue -p | grep "quota" > quota if [ ` ls -l quota | awk '{print $5}' ` -eq 0 ] then echo "there is no quota user" | mail -s quota test@example.com else mail -s "quota" test@example.com < quota fi 上面的脚本也可以这样写 #!/bin/bash cd /backup/mysqlbak postqueue -p | grep "quota" > quota if [[ ! -s quota ]] then echo "there is no quota user" | mail -s quota test@example.com else mail -s "quota" test@example.com < quota fi