ログ回転の動作を理解するには、あなたの助けが必要です。複数の場所で定義されたルールのログの振る舞い
logrotate.conf
:logrotate.d
ディレクトリで
# 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
# use date as a suffix of the rotated file
dateext
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp and btmp -- we'll rotate them here
/var/log/wtmp {
monthly
create 0664 root utmp
minsize 1M
rotate 1
}
/var/log/btmp {
missingok
monthly
create 0600 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
、私は、例えば一つのファイルには、consul-log
を求めている:/var/lib/logrotate.status
で
/var/log/consul {
size 500M
missingok
rotate 0
compress
notifempty
copytruncate
}
、私はこれらの行は(領事ログに関連する見ることができるファイルファイル):
logrotate state -- version 2
"/var/log/consul" 2016-1-25
私の質問は:
- 私は
logrotate.conf
内部rotate 4
を持っていますが、私はlogrotate.d/consul-log
内部rotate 0
を持っている場合は、使用rotate 0
またはrotate 4
をのlogrotateのだろうか?あなたの質問に関しては
あなたのanswwerのおかげで –