古いログファイルは引き続き表示されますが、新しいログファイルは表示されません。

古いログファイルは引き続き表示されますが、新しいログファイルは表示されません。

これは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フラグメントがあるようです。

おすすめ記事