**logrotateの設定と使い方 [#mfe48015]
#Contents
**ディレクトリ構成 [#fe1811e3]
OS標準のlogrotateは以下の設定ファイルを使用して稼動している。~

-本体の動作設定
 /etc/logrotate.conf 

-サービス毎の動作設定
 /etc/logrotate.d/

**設定例1. (apache weekly 24rotate compress) [#g634460b]
 /home/httpd/default/logs/access.log {
   weekly
   compress
   rotate 24
   postrotate
     /etc/init.d/apachectl graceful
   endscript
 }

**設定例2. (apache daily 40rotate compress) [#g94d1664]
 /home/httpd/default/logs/access.log {
   daily
   compress
   rotate 40
   postrotate
     /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
   endscript
 }

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS