Logrotate is not working properly.

Latest response

Once the logrotate has compressed the messages file, it creates a new file and there is nothing in it populated.

cat /etc/logrotate.d/messages

/var/log/messages {
compress
sharedscripts
dateformat -%Y%m%d-%s
rotate 500
size 200M
postrotate
/bin/kill -HUP cat /var/run/syslogd.pid 2> /dev/null 2> /dev/null || true
endscript
}

ls -lrth /etc/logrotate.d/

total 56K
-rw-r--r--. 1 root root 32 Feb 19 2018 up2date
-rw-r--r--. 1 root root 130 Feb 19 2018 btmp
-rw-r--r--. 1 root root 145 Feb 19 2018 wtmp
-rw-r--r--. 1 root root 160 May 10 2019 chrony
-rw-r--r--. 1 root root 93 Aug 7 2020 firewalld
-rw-r--r--. 1 root root 88 Sep 10 2020 subscription-manager
-rw-r--r--. 1 root root 172 Mar 11 2021 iscsiuiolog
-rw-r--r--. 1 root root 88 Apr 12 2021 dnf
-rw-r--r--. 1 root root 226 Aug 6 2021 syslog
-rw-r--r--. 1 root root 237 Jan 17 20:11 sssd
-rw-r--r--. 1 root root 91 Feb 23 18:17 bootlog
-rw-r--r--. 1 root root 162 Apr 12 18:47 kvm_stat
-rw-r--r--. 1 root root 85 Jun 7 18:51 ansible-pull
-rw-r--r--. 1 root root 202 Jun 7 18:51 messages

Similar discussion in https://access.redhat.com/discussions/4500431

Are we missing /etc/logrotate.d/rsyslog file ? do we need to create it ? if so with what content.

Thanks in advance!

Responses