0

I want to use a central syslog-server (Ubuntu 20.04) to collect log events from other linux servers. This is the logrotate.d config file I use:

rotate 90
daily
missingok
nocompress
dateext
dateformat _%Y%m%d_%H%M%S
notifempty
nomail
sharedscripts

/var/rsyslog/*/*
{
    extension .log
}

This is a screenshot as an example of the result after a few days. Please, don’t mind the fact that the screenshot is from a Windows computer. I only moved the file there to easily show an example.

enter image description here

I have read man-pages of logrotate, searched the internet for solution, tried numerous different configurations, but I seem to be unable to avoid filenames wth multiple rotation dates in it. I have also tried not to use dates, but the result remains that filenames will eventually have multiple sequence numbers in them. Does anyone know how to avoid the problem and still have a single date/time stamp in the filename?

2
  • 5
    Does this answer your question? Logrotate appending and not replacing date on filename
    – Haxiel
    Aug 25, 2021 at 15:36
  • @Haxiel , Thank you for pointing me in the direction of that other question. Unfortunately it did not help to solve my problem. I tried to use some other combinations, but in the end I solved it by not using dates/times. That function just seems to be buggy.
    – Jeff
    Sep 14, 2021 at 7:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.