자유게시판

우분투 logroate 설정

작성자 정보

  • 삼둡 작성
  • 작성일

컨텐츠 정보

본문

아파치의  logrotate 설정은 다음과 같다

 

logrotate는 log파일이 커지면 불편해지므로, 적당한 사이즈로 나눠주고 오래된 로그파일은 지워주는 유용한 유틸리티이다.

Logrotate is a useful utility that divides log files into appropriate sizes and erases old log files because they become uncomfortable when they grow larger.

 

root@uu-instance:/etc/logrotate.d# cat apache2 
/var/log/apache2/*.log {
   daily # rotate log files weekly or daily
   missingok #로그파일이 없을경우 에러메시지를 출력하고 다음으로 실행합니다 If there is no log file, output an error message and run it next.
   rotate 14  #회전주기 Rotation cycle
   compress #압축여부 compression or not
   delaycompress 
   notifempty #로그파일의 내용이 없을경우 rotate 하지 않습니다 If you don't have a log file, don't rotate.
   create 640 root adm
   sharedscripts
   prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then
    run-parts /etc/logrotate.d/httpd-prerotate
fi
   endscript
   postrotate
if pgrep -f ^/usr/sbin/apache2 > /dev/null; then
    invoke-rc.d apache2 reload 2>&1 | logger -t apache2.logrotate
fi
   endscript
}
 

 

a20e26cdff3c834432599fa51ae5537e5fa414fbedrn.png

관련자료

댓글 0
등록된 댓글이 없습니다.

인기검색어


최근글


새댓글