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/f01/trackback
List of Articles
번호 제목 글쓴이 날짜 조회 수sort

도메인 Status 상태별 설명 안내

HDD Guardian (a graphical user interface for smartctl)

dpkg 사용법

top 화면 내용중 load average와 PRI : priority(우선순위...

ubuntu 10.04 에서 Nginx, Mysql, PHP5

HP 서버 disk 증설 (hpacucli 사용)

리눅스 메모리 관리, 왜 메모리 여유공간이 없을까? (top ...

windows smartctl

ZFS 파일에 ACL 설정

make 정리

SSL 패스워드 삭제 하기

EXT4 파일 시스템을 Btrfs 파일 시스템으로 변환하기

tar 압축을 실수로 디렉토리 생성 안하고 풀었을때 대처법

ll 명령시 날짜 전체가 보이도록 하기

hddtemp와 mrtg를 이용한 하드디스크 온도 체크 file

python과 mysql 연동시 libmysqlclient_r.so.* 에러가 날 ...

linux 커널 파라메터 수정

우분투(Ubuntu) ssh 설정하기

error: Hm, kex protocol error: type 30 seq 1 [preauth]... file

운영중인 Linux 서버에서 NTFS 파일 시스템 삭제하기

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234