Hi, folks,
This is a real puzzler. The logrotate command is falsely claiming that my log files don't exist and thus is not rotating them. Here's my config file from /etc/logrotate.d:
{
su tomcat tomcat
daily
rotate 30
compress
notifempty
missingok
copytruncate
}
And here's what happens when I run logrotate -f -v <config file>
[root@degreeworksapp3 log]# logrotate -f -v /etc/logrotate.d/degreeworks
reading config file /etc/logrotate.d/degreeworks
Reading state from file: /var/lib/logrotate/logrotate.status
Allocating hash table for state file, size 64 entries
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Handling 1 logs
rotating pattern: /u01/app/tomcat/dwtest/degreeworks/logs/catalina.out
/u01/app/tomcat/dwtest/degreeworks/logs/localhost.log
/u01/app/tomcat/dwtest/degreeworks/logs/StudentPlanner.log
forced from command line (30 rotations)
empty log files are not rotated, old logs are removed
switching euid to 91 and egid to 91
considering log /u01/app/tomcat/dwtest/degreeworks/logs/catalina.out
log /u01/app/tomcat/dwtest/degreeworks/logs/catalina.out does not exist -- skipping
considering log /u01/app/tomcat/dwtest/degreeworks/logs/localhost.log
log /u01/app/tomcat/dwtest/degreeworks/logs/localhost.log does not exist -- skipping
considering log /u01/app/tomcat/dwtest/degreeworks/logs/StudentPlanner.log
log /u01/app/tomcat/dwtest/degreeworks/logs/StudentPlanner.log does not exist -- skipping
switching euid to 0 and egid to 0
set default create context to system_u:object_r:logrotate_var_lib_t:s0
But those files certainly do exist:
[root@degreeworksapp3 log]# find / -type f -ls | egrep -i "(catalina|localhost|StudentPlanner).(out|log)$"
104670524 193300 -rw-r----- 1 tomcat tomcat 197932510 May 10 13:59 /u01/app/tomcat/dwprod/degreeworks/logs/catalina.out
107747857 1236 -rw-r----- 1 tomcat tomcat 1261149 May 10 03:13 /u01/app/tomcat/dwprod/degreeworks/logs/localhost.log
107747866 86704 -rw-r----- 1 tomcat tomcat 88777058 May 10 13:59 /u01/app/tomcat/dwprod/degreeworks/logs/StudentPlanner.log
Your thoughts?
Thanks,
John A
Hi,
logrotate says the files don't exist in /dwtest/, while "find" locates them in /dwprod/.
Regards,
Ilya.
Hi,
logrotate says the files don't exist in /dwtest/, while "find" locates them in /dwprod/.
Regards,
Ilya.
How embarrassing! Thanks!
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.