Skip to content

http://www.superuser.co.kr/home/superuserboard/view.html?code=linux&id=4103


로그파일 삭제하는 방법

ex) /var/log/messages 파일크기가 클때 --> "0"로 만드는법

 cat /dev/null > /var/log/messages 처럼 하시면 됩니다.

--------------------------------------------------------------------------


정기적으로 로그파일 초기화 시키는 부분은
ㅇ /etc/logrotate.conf 파일의 예

[root@fileserver1 /]# cat /etc/logrotate.conf

weekly
rotate 4
create 0600 root root

include /etc/logrotate.d

/var/log/wtmp {
monthly
create 0664 root utmp
rotate 1
}

- logrotated 데몬이 실행되면서 /etc/logrotate.conf파일을 읽어들여서 그 내용을 적용함.

- 위의 “include /etc/logrotate.d” 설정으로 인하여 /etc/logrotate.d 디렉토리에 존재하는 개별로그 파일들을
모두 읽어들여 적용함.


ㅇ daily
해당 로그파일을 매일 로테이트 함.

ㅇ weekly
해당 로그파일을 매주 로테이트 함.

ㅇ monthly
해당 로그파일을 매월 로테이트 함.

ㅇ rotate 숫자
현재 로그파일을 제외한 숫자만큼까지의 로테이트된 파일을 보관함. 이전 로테이트된 파일은 삭제함.
예) “rotate 2”일 경우 해당로그파일이 secure라면
secure 파일(현재파일)과 secure.1파일, secure.2파일까지만 보관됨. 그 이전파일은 자동삭제.


http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#transferlog

profile

일요일은 짜빠게뤼~ 먹는날~^^

엮인글 :
http://adminplay.com/2198/bfb/trackback
List of Articles
번호 제목 글쓴이 날짜 조회 수

crontab 예약실행 file

[Linux] too many files 에러가 날때

서버로그 관리

[리눅스] 파일의 속성관리를 위한 chattr실무활용 -2-

[리눅스] 파일의 속성관리를 위한 chattr실무활용 -1-

ipchains bridge 방화벽 정리 자료. file

웹에서 ssh 를 지원해준다. [webssh] file

포트 포워딩 도구 ipmasqadm file

리눅스서버 응급복구와 삭제파일 복구

리눅스에서 베드섹터 검사명령어

CentOS 설치후 기본언어를 한국어로 바꾸기

리눅스서버 장애처리및 삭제파일 복구

커널 2.6으로 업그레이드!「A to Z」

Cent OS-5.2 설치 문서 GUI

커널 컴파일 장애 처리 perl: warning: Please check that...

rrdtool 컴파일시 에러 configure: error: Please fix the...

FreeBSD 커널패닉 복구하기

usb 부팅 리눅스 만들기(knoppix)

인터넷 속도 단위 (bps, cps)

리눅스 로그파일 관리 [로그파일 삭제하는 방법]

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234