Linux
logrotate 使用所有 CPU 電源
我有預設的 Debian 8.5 Jessie
/etc/logrotate.conf
內容:# see "man logrotate" for details # rotate log files weekly weekly # keep 4 weeks worth of backlogs rotate 4 # create new (empty) log files after rotating old ones create # uncomment this if you want your log files compressed #compress # packages drop log rotation information into this directory include /etc/logrotate.d # no packages own wtmp, or btmp -- we'll rotate them here /var/log/wtmp { missingok monthly create 0664 root utmp rotate 1 } /var/log/btmp { missingok monthly create 0660 root utmp rotate 1 } # system-specific logs may be configured here
使用此設置
logrotate
可以很好地完成工作。但是,如果我改變:rotate 4
不同的東西,例如:
rotate 5
logrotate
從來沒有完成它的工作,消耗了所有的 CPU 能力,所以我最終不得不終止它的程序。這是為什麼?調整時我應該改變一些東西
rotate
嗎?
嘗試尋找一些命令來解析/調試 logrotate 配置而不實際應用它。
從
man logrotate
-d, --debug Turns on debug mode and implies -v. In debug mode, no changes will be made to the logs or to the logrotate state file.
使用你會跑
logrotate -d /etc/logrotate.conf