logrotate does not remove the logs after the configured period
Issue
logrotate
script not removing log files older than two days.
/var/log/rsyslog-application/*.log
/var/log/rsyslog-application/*.log {
daily
rotate 2
notifempty
nocreate
dateext
compress
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}
- Above
logrotation
configuration should keep only two files and remove all the logfiles.
But it is not working as expected.
Environment
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- logrotate
- Rsyslog
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.