郵件超出配額小腳本

郵箱超出配額小腳本
內容如下
#!/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 [email protected]
else
mail -s "quota" [email protected] < 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 [email protected]
else
mail -s "quota" [email protected] < quota
fi
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章