logrotate 日志自动分割

执行

# */1 * * * * /usr/sbin/logrotate -v /etc/logrotate.d/test >> /tmp/logrotate.log
$ logrotate /etc/logrotate.d/test

配置

$ cat test
/home/hk/log/log.log {
    size 1024MB
    rotate 10000
    copytruncate
    create
    compress
    delaycompress
    notifempty
}