아파치에서 logrotate를 쓰려고 합니다만...

zz181321의 이미지

CustomLog "|/usr/sbin/rotatelogs2 /var/logs/apache/access_log 604800" combine

이렇게 설정했습니다.

그리고 실행 후 error_log에 남는걸 보면,

1 Previous file handle doesn't exists /var/logs/apache/access_log.1169078400
piped log program '/usr/sbin/rotatelogs2 /var/logs/apache/access_log 604800' failed unexpectedly

라고 뜨는데, 원인을 모르겠습니다.

로그로테이트가 잘 작동중인지 어떤지도요.

문법을 여러번 바꾸었는데도, 실행 되는 경우에는 저 메세지가 항상 뜨네요.

송효진의 이미지

/usr/sbin/rotatelogs2 이것이 파이프로 로그를 쌓는 모듈 맞나요?

echo asdf | rotatelogs2 test.log 604800

해 보세요.

cronolog 라고 일,월,연별로 로그파일을 나누거나 디렉토리를 나눌 수 있는것도 있습니다.

emerge money

zz181321의 이미지

왜냐하면, 터미널에서 그냥 실행시켜보면

Usage: rotatelogs2 [-l] [offset minutes from UTC] or

Add this:

TransferLog "|rotatelogs2 /some/where 86400"

to httpd.conf

라고 뜹니다.