로그 순환이 작동하지 않는 이유는 무엇입니까?

로그 순환이 작동하지 않는 이유는 무엇입니까?

매일 애플리케이션의 로그를 교체하려고 하는데 알 수 없는 이유로 작동하지 않습니다. logrotate 정의를 디버깅하면 회전하지 않을 것이라고 말합니다. 그러나 강제로 회전시키는 경우에만 작동합니다.

내가 여기서 무엇을 놓치고 있는 걸까요?

logrotate 정의(/etc/logrotate.d/application)

/tmp/company.0000/application.log {
  daily
  rotate 7
  compress
  copytruncate
  missingok
  extension .log
  dateext
  dateformat _%Y%m%d
  su root valter
  create 440 valter valter
}

폴더의 모든 항목 나열

valter@eniac:~$ ls -ltha /tmp/company.0000/
total 2,8M
drwxrwxrwx 9 root   root    96K Aug 30 17:25 ..
drwxrwxr-x 2 valter valter 4,0K Aug 30 17:25 .
-rw-rw-r-- 1 valter valter 2,7M Aug 30 17:00 application.log

수정된 파일 날짜

valter@eniac:~$ sudo touch -m --date="2016-08-01" /tmp/company.0000/application.log
valter@eniac:~$ ls -ltha /tmp/company.0000/
total 2,8M
drwxrwxrwx 9 root   root    96K Aug 30 17:25 ..
drwxrwxr-x 2 valter valter 4,0K Aug 30 17:25 .
-rw-rw-r-- 1 valter valter 2,7M Aug  1 00:00 application.log

로그 자체를 수정하지 않고 logrotate 디버깅

valter@eniac:~$ sudo logrotate -d /etc/logrotate.d/application 
reading config file /etc/logrotate.d/application
extension is now .log

Handling 1 logs

rotating pattern: /tmp/company.0000/application.log  after 1 days (7 rotations)
empty log files are rotated, old logs are removed
switching euid to 0 and egid to 1000
considering log /tmp/company.0000/application.log
  log does not need rotating
switching euid to 0 and egid to 0

강제 로그 회전 및 목록

valter@eniac:~$ sudo logrotate --force /etc/logrotate.d/application 
valter@eniac:~$ ls -ltha /tmp/company.0000/
total 264K
drwxrwxr-x 2 valter valter 4,0K Aug 30 17:26 .
-rw-rw-r-- 1 valter valter    0 Aug 30 17:26 application.log
drwxrwxrwx 9 root   root    96K Aug 30 17:25 ..
-rw-rw-r-- 1 valter valter 158K Aug  1 00:00 application_20160830.log.gz

관련 정보