Logrotate

Jmnote (토론 | 기여)님의 2014년 2월 2일 (일) 12:07 판 (→‎기본 설정)

1 개요

logrotate
로그 로테이트
/usr/sbin/logrotate
  • 시스템 로그 순환, 압축, 메일발송 자동화

2 기본 설정

CentOS 기본 설정이다.

[root@jmnote ~]# cat /etc/logrotate.conf | egrep -v "^[[:space:]]*$" | grep -v ^#
weekly
rotate 4
create
dateext
include /etc/logrotate.d
/var/log/wtmp {
    monthly
    create 0664 root utmp
	minsize 1M
    rotate 1
}
/var/log/btmp {
    missingok
    monthly
    create 0600 root utmp
    rotate 1
}
→ /etc/logratotat.conf에는 wtmp, btmp에 대한 것만 있고, 다른 로그에 대해서는 /etc/logrotate.d 폴더에 설정한다.
[root@jmnote ~]# ll /etc/logrotate.d
total 32
-rw-r--r--. 1 root root  71 Jun 22  2012 cups
-rw-r--r--. 1 root root 103 Jun 22  2012 dracut
-rw-r--r--. 1 root root 185 Feb  7  2012 httpd
-rw-r--r--. 1 root root 136 Aug 22  2010 ppp
-rw-r--r--. 1 root root 329 Jun 22  2012 psacct
-rw-r--r--. 1 root root 210 May 17  2012 syslog
-rw-r--r--. 1 root root 100 Jun 22  2012 wpa_supplicant
-rw-r--r--. 1 root root 100 Jun 22  2012 yum

3 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}