- PR -

logrotateでの過去ログ保存数について

1
投稿者投稿内容
たみお
会議室デビュー日: 2004/10/02
投稿数: 11
投稿日時: 2005-06-13 18:27
logrotateにて過去ログの保存数を設定しているのですが、想定した動作をしません。
下記の設定にて、週次で48週分の過去ログを保存するよう設定したいのですが、過去ログが4週分しか保存されません。
なお、/etc/logrotate.d/syslog 内にて「rotate 48」を明示的に設定すると48週分のログが保存されます。
※syslog以外のログについても48週分のログを保存したいため、グローバル設定(/etc/logrotate.conf)にて設定したいと考えています。

アドバイス、ご指摘などありましたら、よろしくお願いいたします。

【/etc/logrotate.conf】
------------------------------------------------
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 48 ← デフォルトの4から48に変更

# create new (empty) log files after rotating old ones
create

# 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 -- we'll rotate them here
/var/log/wtmp {
monthly
create 0664 root utmp
rotate 1
}
------------------------------------------------

【/etc/logrotate.d/syslog】
------------------------------------------------
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}
------------------------------------------------
hohojp
常連さん
会議室デビュー日: 2005/02/15
投稿数: 31
投稿日時: 2005-06-13 21:59
こんばんわ。

想定どおり動作しなかったのは、cron処理でのことでしょうか?
それとも、コマンドライン上ですか?

/usr/sbin/logrotate /etc/logrotate.conf

ひょっとしてですが、一回、上記のコマンドなどを行って、それぞれのログ
が、1週間以内のログだけになっていて、48週分に分割しても、分割でき
ないとかないでしょうか?(設定が「weekly 」になっているから)
1

スキルアップ/キャリアアップ(JOB@IT)