Postfixで溜まってしまった古いキューファイルを削除するシェルスクリプト
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[Postfix]]
*説明 [#rab722de]
postfixでなぜか何故か半年前とかの古いキューメールが残る場...
その場合の対処として、配送月をmailqコマンドでチェックして...
cronで月末とか15日とかに設定すればOKかと。
*シェルスクリプト [#z7a00cd8]
#!/bin/bash
export LANG=c
DATE01=`date +%b '--date=1 months ago'`
LIST01=`mailq | grep ${DATE01} | awk '{print $1}' | sed ...
if [ -n "${LIST01}" ];then
echo "not null"
for inlist in ${LIST01}
do
postsuper -d ${inlist}
done
else
echo "null"
exit;
fi
終了行:
[[Postfix]]
*説明 [#rab722de]
postfixでなぜか何故か半年前とかの古いキューメールが残る場...
その場合の対処として、配送月をmailqコマンドでチェックして...
cronで月末とか15日とかに設定すればOKかと。
*シェルスクリプト [#z7a00cd8]
#!/bin/bash
export LANG=c
DATE01=`date +%b '--date=1 months ago'`
LIST01=`mailq | grep ${DATE01} | awk '{print $1}' | sed ...
if [ -n "${LIST01}" ];then
echo "not null"
for inlist in ${LIST01}
do
postsuper -d ${inlist}
done
else
echo "null"
exit;
fi
ページ名: