이전 로그 파일은 계속 표시되지만 새 로그 파일은 표시되지 않는 이유는 무엇입니까?

이전 로그 파일은 계속 표시되지만 새 로그 파일은 표시되지 않는 이유는 무엇입니까?

이것은 logrotate에 대한 나의 설정입니다.

 /home/sy/logs/kitxit*/*/tend.log
    {
        daily
        rotate 10
        dateext
        compress
        delaycompress
        copytruncate
        missingok
        notifempty
        su apache apache
    }

출력은 다음과 같습니다

drwxr-xr-x 2 apache apache     4096 Apr 30 13:00 .
drwxr-xr-x 6 apache apache     4096 Apr 30 13:00 ..
-rw-r--r-- 1 apache apache 21318609 May  2 21:25 tend.log
-rw-r--r-- 1 apache apache     4091 Feb 24 03:02 tend.log-20200224.gz
-rw-r--r-- 1 apache apache     4065 Feb 25 03:02 tend.log-20200225.gz
-rw-r--r-- 1 apache apache     4460 Feb 26 03:03 tend.log-20200226.gz
-rw-r--r-- 1 apache apache     4049 Feb 27 03:03 tend.log-20200227.gz
-rw-r--r-- 1 apache apache     2619 Feb 28 03:03 tend.log-20200228.gz
-rw-r--r-- 1 apache apache     1312 Feb 29 03:03 tend.log-20200229.gz
-rw-r--r-- 1 apache apache     1339 Mar  1 03:03 tend.log-20200301.gz
-rw-r--r-- 1 apache apache     1305 Mar  2 03:03 tend.log-20200302.gz
-rw-r--r-- 1 apache apache     2669 Mar  3 03:02 tend.log-20200303.gz
-rw-r--r-- 1 apache apache    70011 Mar  4 03:03 tend.log-20200304

이전 로그 파일은 계속 표시되지만 새 로그 파일은 표시되지 않는 이유는 무엇입니까?

디버그 모드 결과입니다

 [root@xavs-ken logrotate.d]# logrotate -dv kitxit-tend-sylog
reading config file kitxit-tend-sylog
Allocating hash table for state file, size 15360 B

Handling 1 logs

rotating pattern: /home/sy/logs/kitxit*/*/tend/*.log
/home/sy/logs/kitxit*/*/sylog/*.log
 after 1 days (10 rotations)
empty log files are not rotated, old logs are removed
switching euid to 48 and egid to 48
considering log /home/sy/logs/kitxit2/bola/tend/sql.log
  log needs rotating
considering log /home/sy/logs/kitxit2/bola/tend/tend.log
  log needs rotating
considering log /home/sy/logs/kitxit/bola/tend/mem.log
  log does not need rotating (log is empty)considering log /home/sy/logs/kitxit/bola/tend/tend.log
  log needs rotating
considering log /home/sy/logs/kitxit/clpl/tend/sql.log
  log needs rotating
considering log /home/sy/logs/kitxit/clpl/tend/tend.log
  log needs rotating
considering log /home/sy/logs/kitxit/mol/tend/tend.log
  log needs rotating
considering log /home/sy/logs/kitxit/pola/tend/tend.log
  log needs rotating
considering log /home/sy/logs/kitxit/solsa/tend/sql.log
  log needs rotating
considering log /home/sy/logs/kitxit/solsa/tend/tend.log
  log needs rotating
considering log /home/sy/logs/kitxit/sario/tend/mem.log
  log does not need rotating (log is empty)considering log /home/sy/logs/kitxit/sario/tend/tend.log
  log needs rotating
considering log /home/sy/logs/kitxit/sasu/tend/tend.log
  log needs rotating
considering log /home/sy/logs/kitxit/kilo/tend/tend.log
  log needs rotating
considering log /home/sy/logs/kitxit/mixi/tend/mem.log
  log does not need rotating (log is empty)considering log /home/sy/logs/kitxit/mixi/tend/tend.log
  log needs rotating
considering log /home/sy/logs/kitxit/aziz/tend/tend.log
  log needs rotating
considering log /home/sy/logs/kitxit/xondana/tend/tend.log
  log needs rotating
considering log /home/sy/logs/kitxit2/bola/sylog/action.log
  log needs rotating
considering log /home/sy/logs/kitxit/bola/sylog/action.log
  log needs rotating
considering log /home/sy/logs/kitxit/clpl/sylog/action.log
  log needs rotating
considering log /home/sy/logs/kitxit/mol/sylog/action.log
  log needs rotating
considering log /home/sy/logs/kitxit/pola/sylog/action.log
  log needs rotating
considering log /home/sy/logs/kitxit/solsa/sylog/action.log
  log needs rotating
considering log /home/sy/logs/kitxit/entag/sylog/action.log
  log does not need rotating (log is empty)considering log /home/sy/logs/kitxit/sario/sylog/action.log
  log needs rotating
considering log /home/sy/logs/kitxit/sasu/sylog/action.log
  log needs rotating
considering log /home/sy/logs/kitxit/kilo/sylog/action.log
  log needs rotating
considering log /home/sy/logs/kitxit/mixi/sylog/action.log
  log needs rotating
considering log /home/sy/logs/kitxit/aziz/sylog/action.log
  log needs rotating
considering log /home/sy/logs/kitxit/xondana/sylog/action.log
  log needs rotating
rotating log /home/sy/logs/kitxit2/bola/tend/sql.log, log->rotateCount is 10
dateext suffix '-20200503'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding logs to compress failed
copying /home/sy/logs/kitxit2/bola/tend/sql.log to /home/sy/logs/kitxit2/bola/tend/sql.log-20200503
truncating /home/sy/logs/kitxit2/bola/tend/sql.log
rotating log /home/sy/logs/kitxit2/bola/tend/tend.log, log->rotateCount is 10
dateext suffix '-20200503'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding logs to compress failed
glob finding old rotated logs failed

...

답변1

디버그 출력의 로그 파일이 구성 파일의 logrotate 경로와 일치하지 않습니다.

tend.log디버그 출력에서 ​​일치하는 파일

considering log /home/sy/logs/kitxit2/bola/tend/tend.log
considering log /home/sy/logs/kitxit/clpl/tend/tend.log
considering log /home/sy/logs/kitxit/mol/tend/tend.log
considering log /home/sy/logs/kitxit/pola/tend/tend.log
considering log /home/sy/logs/kitxit/solsa/tend/tend.log
considering log /home/sy/logs/kitxit/sasu/tend/tend.log
considering log /home/sy/logs/kitxit/kilo/tend/tend.log
considering log /home/sy/logs/kitxit/aziz/tend/tend.log
considering log /home/sy/logs/kitxit/xondana/tend/tend.log

로그 순환 구성

/home/sy/logs/kitxit*/*/tend.log

고려 중인 파일, 즉 */경로의 다른 파일 과 일치하도록 패턴을 다음과 같이 수정해야 합니다.

/home/sy/logs/kitxit*/*/*/tend.log

대상 파일이 디버그 출력에서 ​​참조되므로 어딘가에 3월 4일/5일쯤 작동이 중지된 또 다른 logrotate 조각이 있는 것 같습니다.

관련 정보