[Linux] logrotate 설정에 대한 재고

기본적으로 /etc/logrotate.d 하위에 파일을 생성하고 이를 토대로 logroate가 수행되게 하면 되는데,

가끔 처음 설정 시 테스트 귀찮아서 점검 안 하면 설정은 해 놓고 안될 때가 있음.

  1 /log_data/haproxy.log {
  2     daily
  3     rotate 52
  4     missingok
  5     notifempty
  6     compress
  7     delaycompress
  8     su root root
  9     create 644 root adm
 10     postrotate
 11         invoke-rc.d rsyslog rotate >/dev/null 2>&1 || true
 12     endscript
 13 }

그 경우 다음과 같이 debug 를 돌리면 어떤 이슈로 rotate를 안했는지 알 수 있음.

sudo logrotate –debug /etc/logrotate.conf

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다