Per Jessen wrote:
Andrei Borzenkov wrote:
How do you test your modifications? Are you calling logrotate manually? If yes, how exactly?
To be honest, I didn't test them :-) I do this modification on every new install, hopefully I know it by now.
I'll look up how to to run a test run.
logrotate -d -v /usr/etc/logrotate.conf /etc/logrotate.d/syslog (a dry run). [snip some] rotating pattern: /var/log/messages /var/log/mail after 1 days (30 rotations) empty log files are not rotated, old logs are removed considering log /var/log/messages Now: 2023-04-24 11:29 Last rotated at 2023-04-24 00:00 log does not need rotating (log has been rotated at 2023-04-24 00:00, which is less than a day ago) considering log /var/log/mail Now: 2023-04-24 11:29 Last rotated at 2023-04-24 00:00 log does not need rotating (log has been rotated at 2023-04-24 00:00, which is less than a day ago) not running postrotate script, since no logs were rotated ------------------------------ Running a rotate with 'force' works: rotating pattern: /var/log/messages /var/log/mail forced from command line (30 rotations) empty log files are not rotated, old logs are removed considering log /var/log/messages Now: 2023-04-24 11:32 Last rotated at 2023-04-24 00:00 log needs rotating considering log /var/log/mail Now: 2023-04-24 11:32 Last rotated at 2023-04-24 00:00 log needs rotating rotating log /var/log/messages, log->rotateCount is 30 dateext suffix '-20230424' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' glob finding old rotated logs failed rotating log /var/log/mail, log->rotateCount is 30 dateext suffix '-20230424' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' glob finding old rotated logs failed renaming /var/log/messages to /var/log/messages-20230424 creating new /var/log/messages mode = 0640 uid = 0 gid = 0 renaming /var/log/mail to /var/log/mail-20230424 creating new /var/log/mail mode = 0640 uid = 0 gid = 0 running postrotate script compressing log with: /usr/bin/xz compressing log with: /usr/bin/xz --------------------------------------- Okay, I guess the next one has to be with the full config. -- Per Jessen, Zürich (9.9°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes