Logs are not shifting to new directory after log rotation

us flag

I am facing issue. We have setup log forwarder for sentinel and logs are frequently coming on /var/log/messages.

Actual problem is

i have created one script for log rotation and placed it under /etc/logrotate.d/ with name messages.conf below is the configuration image of text

Now this scripts at 3AM and creates a new directory as per today's date and ideally after that the logs should start coming in nee directory bu it is not.

what is happening actually is on the first rotation the logs will be shifted from /var/log/messages to /var/log/messages-20220517 but when script will run next day it will create a directory /var/log/messages-20220518 but logs will still be coming in previous day directory /var/log/messages-20220517. another image of text

just FYI we have not made any changes in any other conf file.

Flavor - CentOS Linux release 7.9.2009 (Core)

Can anyone let me what is the issue are we missing something? how can we get this sorted we are stuck here.

Romeo Ninov avatar
in flag
Please replace images with text
pl flag
Why do you think that " logs should start coming in nee directory ..". Also, please replace images containing configs with text. Why?, read here

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.