ExtMail服务器社区's Archiver

shenbo7 发表于 2010-8-24 14:16

maillog 日志 切割 按日 分割

在 /etc/logrotate.d 目录中
把syslog文件中的/var/log/maillog字段去除;
新建个maillog文件,在里面写入
/var/log/maillog {
    daily
    rotate 32
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
        /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

/usr/sbin/logrotate -vf /etc/logrotate.d/maillog
测试通过

wxd5981 发表于 2010-8-25 22:07

恩.cronolog也不错

页: [1]

Powered by Discuz! Archiver 7.0.0  © 2001-2009 Comsenz Inc.