-
Notifications
You must be signed in to change notification settings - Fork 216
Description
Hello,
We're using logrotate on Red Hat Enterprise Linux 8, with the following configuration file:
/var/log/containers/*/*log {
daily
rotate 14
maxage 14
# minsize 1 is required for GDPR compliance, all files in
# /var/log/containers not managed with logrotate will be purged!
minsize 1
# Do not use size as it's not compatible with time-based rotation rules
# required for GDPR compliance.
maxsize 10M
missingok
notifempty
copytruncate
delaycompress
compress
}
We run logrotate from a cron job, with the following command:
/usr/sbin/logrotate -s /var/lib/logrotate/logrotate-crond.status /etc/logrotate-crond.conf
Here's the result of a "-v" run:
reading config file /etc/logrotate-crond.conf
Reading state from file: /var/lib/logrotate/logrotate-crond.status
Allocating hash table for state file, size 64 entries
Handling 1 logs
rotating pattern: /var/log/containers/*/*.log after 1 days (14 rotations)
empty log files are not rotated, only log files >= 1 bytes are rotated, log files >= 10485760 are rotated earlier, old logs are removed
No logs found. Rotation not needed.
We do have a file matching the criteria, located in /var/log/containers/nova/ directory:
-rw-r--r--. 1 nova nova 275M Jun 20 11:43 nova-placement-api-test.log
Its size is good for a rotation due to the "maxsize 10M".
The status file doesn't list any file, meaning it didn't find anything:
cat /var/lib/logrotate/logrotate-crond.status
logrotate state -- version 2
If we replace the path set in the configuration file with a single-level wildcard, for instance
/var/log/containers/nova/*log
it does find the logs and does the rotation as expected, meaning the configuration itself is apparently working - there's "just" the wildcard issue...
Here are the information about logrotate version:
logrotate 3.14.0
Default mail command: /bin/mail
Default compress command: /bin/gzip
Default uncompress command: /bin/gunzip
Default compress extension: .gz
Default state file path: /var/lib/logrotate/logrotate.status
ACL support: yes
SELinux support: yes
Care to investigate a bit and provide some help?
Thank you!
Cheers,
C.