我的日志正在旋转正常,但是,我没有通过电子邮件发送旋转的日志。 我究竟做错了什么?
我的主要logrotate.conf是:
include /etc/logrotate.d
这里是我的/etc/logrotate.d/php-errors:
/var/log/php-errors.log { rotate 7 daily missingok notifempty mail [email protected] }
您将需要确保您已将sendmail(或等效MTA)正确configuration为能够发送邮件,然后在/etc/logrotate.d/php-errors中/etc/logrotate.d/php-errors您的configuration中命令的完整path;
/var/log/php-errors.log { rotate 7 daily missingok notifempty /bin/mail [email protected] }
原来我误解了邮件命令。 它寄出即将被删除的日志。 我想只是旋转的日志,所以我不得不将“mailfirst”指令添加到我的configuration文件。