following output shows that logrotate not dealed with older log files, please why and how to fix it?
Debian 11, 5.10.0-18-amd64
$ grep -v "#" /etc/logrotate.conf|grep .
Code: Select all
hourly
rotate 1
shred
dateext
compress
lastaction
find /var/log -type f -mtime +1 -delete
endscript
Code: Select all
total 110M
-rw-r----- 1 root adm 338K Feb 7 08:17 auth.log
-rw-r----- 1 root adm 39M Feb 7 08:01 daemon.log
-rw-r----- 1 root adm 71M Feb 7 08:01 syslog
drwx------ 2 root root 4.0K Feb 7 03:38 letsencrypt
-rw-r----- 1 root adm 196K Feb 5 00:06 messages
-rw-r----- 1 root adm 4.9K Feb 5 00:06 user.log
-rw-rw-r-- 1 root utmp 286K Feb 4 08:54 lastlog
-rw-rw-r-- 1 root utmp 48K Feb 4 08:54 wtmp
-rw-r--r-- 1 root root 56K Feb 1 05:37 dpkg.log
-rw-r--r-- 1 root root 5.9K Feb 1 05:35 alternatives.log
drwxr-xr-x 2 root root 4.0K Feb 1 05:35 apt
-rw-r----- 1 root adm 2.4K Jan 23 15:23 debug
-rw-r----- 1 root adm 190K Jan 23 15:23 kern.log
drwxr-x--- 2 root adm 4.0K Dec 6 05:55 unattended-upgrades
drwxr-xr-x 2 root adm 4.0K Oct 31 18:33 nginx
drwxr-x--- 2 _chrony _chrony 4.0K Sep 20 11:01 chrony
drwx------ 2 root root 4.0K Sep 20 11:01 private
drwxr-sr-x+ 3 root systemd-journal 4.0K Sep 20 11:01 journal
drwxr-xr-x 3 root root 4.0K Jul 11 2022 runit
drwxr-xr-x 2 root root 4.0K May 14 2021 openvpn
Code: Select all
● logrotate.service - Rotate log files
Loaded: loaded (/lib/systemd/system/logrotate.service; static)
Active: inactive (dead) since Tue 2023-02-07 00:00:01 CET; 8h ago
TriggeredBy: ● logrotate.timer
Docs: man:logrotate(8)
man:logrotate.conf(5)
Process: 575041 ExecStart=/usr/sbin/logrotate /etc/logrotate.conf (code=exited, status=0/SUCCESS)
Main PID: 575041 (code=exited, status=0/SUCCESS)
CPU: 33ms
Code: Select all
Feb 04 00:00:02 host systemd[1]: Finished Rotate log files.
Feb 05 00:00:01 host systemd[1]: Starting Rotate log files...
Feb 05 00:00:01 host systemd[1]: logrotate.service: Succeeded.
Feb 05 00:00:01 host systemd[1]: Finished Rotate log files.
Feb 06 00:00:00 host systemd[1]: Starting Rotate log files...
Feb 06 00:00:00 host systemd[1]: logrotate.service: Succeeded.
Feb 06 00:00:00 host systemd[1]: Finished Rotate log files.
Feb 07 00:00:01 host systemd[1]: Starting Rotate log files...
Feb 07 00:00:01 host systemd[1]: logrotate.service: Succeeded.
Feb 07 00:00:01 host systemd[1]: Finished Rotate log files.
I have commented out "*.* stop" line in /etc/rsyslog.conf to hopefully enable system logging to tell me why it is not removing older log files as per the "ls" output above and ran "sudo systemctl restart rsyslog"