logrotate not working
I tried this on multiple servers of RHEL7, none of them works
cat /etc/logrotate.d/tomcat
/apps/tomcat/logs/catalina.out
{
daily
rotate 7
size=1M
notifempty
missingok
copytruncate
compress
}
/usr/sbin/logrotate -dvf /etc/logrotate.conf
...
rotating pattern: /apps/tomcat/logs/catalina.out
forced from command line (7 rotations)
empty log files are rotated, old logs are removed
considering log /apps/tomcat/logs/catalina.out
log needs rotating
rotating log /apps/tomcat/logs/catalina.out, log->rotateCount is 7
dateext suffix '-20220609'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
fscreate context set to unconfined_u:object_r:unlabeled_t:s0
renaming /apps/tomcat/logs/catalina.out to /apps/tomcat/logs/catalina.out-20220609
creating new /apps/tomcat/logs/catalina.out mode = 0640 uid = 3000 gid = 3000
...
but in fact it didn't happen at all
ls -al /apps/tomcat/logs/catalina.out*
-rw-r-----. 1 xxx xxx 32188344 Jun 9 18:01 /apps/tomcat/logs/catalina.out
I masked uid/gid off from the output