解决方案 :
在 crontab 的第一行的变量中使用“MAILTO”。
例如
<start of file> MAILTO=otheruser@onitroad.com 01 01 * * * /usr/sbin/ntpdate 0.pool.ntp.org 01 05 * * * some-other-command 01 06 * * * another-command <end of file>
问题 :
cron 作业的状态通常发送到服务器的根目录。
有时我们不想将cron输出或者错误消息发送给 root 或者 /etc/aliases 中的任何人。
仅发送给我们信任的电子邮件或者服务器上的普通用户。
有没有办法只发送到除 root 之外的另一个电子邮件地址?
或者其他然后 /etc/aliases 中的别名?
日期:2020-06-02 22:18:23 来源:oir作者:oir