편집을 취소할 수 있습니다. 이 편집을 되돌리려면 아래의 바뀐 내용을 확인한 후 게시해주세요.
최신판 | 당신의 편집 | ||
14번째 줄: | 14번째 줄: | ||
==conf 구조== | ==conf 구조== | ||
<source lang=' | <source lang='cli'> | ||
[root@zetawiki ~]# cat /etc/logrotate.conf | egrep -v "^[[:space:]]*$" | grep -v ^# | [root@zetawiki ~]# cat /etc/logrotate.conf | egrep -v "^[[:space:]]*$" | grep -v ^# | ||
weekly | weekly | ||
36번째 줄: | 36번째 줄: | ||
:→ [[/etc/logrotate.conf]]에는 [[wtmp]], [[btmp]]에 대한 것만 있고, 다른 로그에 대해서는 /etc/logrotate.d 폴더에 설정한다. | :→ [[/etc/logrotate.conf]]에는 [[wtmp]], [[btmp]]에 대한 것만 있고, 다른 로그에 대해서는 /etc/logrotate.d 폴더에 설정한다. | ||
:→ 이 파일은 하위 파일들에 대해 템플릿의 역할을 한다(상속). 옵션을 따로 명기하지 않으면 주단위(weekly), 보존파일 최대 4개(rotate 4) 등이 적용된다. | :→ 이 파일은 하위 파일들에 대해 템플릿의 역할을 한다(상속). 옵션을 따로 명기하지 않으면 주단위(weekly), 보존파일 최대 4개(rotate 4) 등이 적용된다. | ||
<source lang=' | <source lang='cli'> | ||
[root@zetawiki ~]# ll /etc/logrotate.d | [root@zetawiki ~]# ll /etc/logrotate.d | ||
total 84 | total 84 | ||
45번째 줄: | 45번째 줄: | ||
</source> | </source> | ||
:→ 여러가지 로그순환 설정이 되어 있다. 여기서는 httpd를 살펴보자. | :→ 여러가지 로그순환 설정이 되어 있다. 여기서는 httpd를 살펴보자. | ||
<source lang=' | <source lang='cli'> | ||
[root@zetawiki ~]# cat /etc/logrotate.d/httpd | [root@zetawiki ~]# cat /etc/logrotate.d/httpd | ||
/var/log/httpd/*log { | /var/log/httpd/*log { | ||
57번째 줄: | 57번째 줄: | ||
</source> | </source> | ||
:→ /etc/logrotate.d/httpd는 /var/log/httpd/*log 에 대해 적용된다. | :→ /etc/logrotate.d/httpd는 /var/log/httpd/*log 에 대해 적용된다. | ||
<source lang=' | <source lang='cli'> | ||
[root@zetawiki ~]# ll /var/log/httpd/*log | [root@zetawiki ~]# ll /var/log/httpd/*log | ||
-rw-r--r-- 1 root root 2362719 Feb 2 13:25 /var/log/httpd/access_log | -rw-r--r-- 1 root root 2362719 Feb 2 13:25 /var/log/httpd/access_log | ||
63번째 줄: | 63번째 줄: | ||
</source> | </source> | ||
:→ /var/log/httpd/*log는 곧 access_log과 error_log이다. | :→ /var/log/httpd/*log는 곧 access_log과 error_log이다. | ||
<source lang=' | <source lang='cli'> | ||
[root@zetawiki ~]# ll /var/log/httpd/*log* | [root@zetawiki ~]# ll /var/log/httpd/*log* | ||
-rw-r--r-- 1 root root 2362719 Feb 2 13:25 /var/log/httpd/access_log | -rw-r--r-- 1 root root 2362719 Feb 2 13:25 /var/log/httpd/access_log |