logrotate를 사용하면 처리하는 당일의 날짜로 파일을 압축할 수 있다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/test/logs/catalina.out { | |
copytruncate // catalina.out 에 원본을 남기지 않는다 | |
daily // 매일 수행한다 | |
rotate 30 // | |
//logrotate 의 실행결과 순환되는 파일들의 총 갯수임. | |
//즉, logrotate 의 결과 삭제되거나 지정된 주소로 메일을 보내기 전의 총 파일갯수라고 이해하면 됨. | |
// 그리고 rotate 0 로 설정하고 나면 이전파일은 순환과 함께 삭제되어 버림. | |
compress //압축 | |
missingok // 파일이 없어도 에러를 내지 않음 | |
notifempty // 파일이 비어있으면 수행하지 않음 | |
dateext // 날짜를 파일명 뒤에 찍음 (dateformat을 지정할 수도 있음 ) | |
dateyesterday // 날짜를 어제 날짜로 찍음 | |
maxage 30 // 살아있을 수 있는 날짜가 30일 | |
} |
'삽질공유' 카테고리의 다른 글
http request 전송할 때 content-type 설정하기 (0) | 2016.04.11 |
---|---|
logrotate (1) | 2016.03.28 |
springboot actuator (0) | 2016.03.25 |
logrotate.d (0) | 2016.03.25 |
git pull request 하기 전에 rebase를 해야 하는가? (0) | 2016.03.17 |