
デフォルトの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
?
答え1
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