#変更 vi /etc/logrotate.conf #適用 logrotate /etc/logrotate.conf #ログローテート強制実行 logrotate -f /etc/logrotate.conf
変更するのは、ローテーションの間隔と保存する世代数で良い
#ローテーションを実施する間隔 #[daily | weekly | monthly | yearly] weekly #保存する世代数 #rotate [数値] rotate 4 #ローテート後に新しいファイルを作成 #[create | nocreate] create #個別にログ設定ファイルを読み込むディレクトリパス include /etc/logrotate.d #ローテート後ファイルの接尾辞(dateextは日付、nodateextは連番) #[dateext | nodateext] dateext
# 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 # system-specific logs may be also be configured here.