Ubuntu-12.04
日誌輪換無法先處理郵件
我
custom
在目錄/etc/logrotation.d/custom
中命名的 Ubuntu 伺服器上配置了日誌輪換,條目如下/var/log/apache2/access.log { daily mailfirst tarun@example.com missingok rotate 52 compress delaycompress notifempty create 640 root adm sharedscripts postrotate /etc/init.d/apache2 reload > /dev/null endscript prerotate if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ run-parts /etc/logrotate.d/httpd-prerotate; \ fi; \ endscript }
但是當我執行命令時
logrotate -f /etc/logrotate.d/custom
,它給出了以下錯誤。logrotate -f custom error: custom:3 unexpected text
它在行中給出錯誤
mailfirst tarun@example.com
。為什麼?請幫忙。
它應該是:
var/log/apache2/access.log { daily mail tarun@example.com mailfirst missingok rotate 52 compress delaycompress notifempty create 640 root adm sharedscripts postrotate /etc/init.d/apache2 reload > /dev/null endscript prerotate if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ run-parts /etc/logrotate.d/httpd-prerotate; \ fi; \ endscript }