Disable The Mail Alert By Crontab Command On a Linux or Unix-like Systems

自從安裝好 postfix 後,發現 root 帳號會有很多信進來,原來是 crontab 會寄信!

解法:

You can set the MAILTO variable in your crontab.

Just type the following at the top of your crontab (crontab -e):

MAILTO=""

and cron will not send any mail for any of the jobs. If you have to disable mails for a specific task, use the following:

@hourly /path/to/script.sh >/dev/null 2>&1

相關文章

寫留言

你的電子郵件位址並不會被公開。 必要欄位標記為 *