Tenho esta configuração para detalhes de log:
/opt/freeradius/logs/*/detail {
daily
rotate 4
compress
delaycompress
missingok
notifempty
create 0640 root root
sharedscripts
maxsize 500M
postrotate
/bin/systemctl reload freeradius > /dev/null 2>/dev/null || true
endscript
}
Tenho esses logs antigos com logs novos:
[root@freeradius01 192.168.17.10]# pwd
/opt/freeradius/logs/192.168.17.10
[root@freeradius01 192.168.17.10]# ll
total 56919724
-rwxrwxrwx 1 root root 21048752215 Aug 14 23:59 detail-20240814
-rwxrwxrwx 1 root root 21617187765 Aug 15 23:59 detail-20240815
-rwxrwxrwx 1 root root 5988044800 Aug 16 23:59 detail-20240816
-rwxrwxrwx 1 root root 5947392 Sep 25 23:59 detail-20240925
-rwxrwxrwx 1 root root 7478423552 Oct 21 23:59 detail-20241021
-rwxrwxrwx 1 root root 1907452140 Oct 22 11:19 detail-20241022
[root@freeradius01 192.168.17.10]#
Ao executar o logrotate manualmente e forçado com verbos, tenho este resultado:
[root@freeradius01 192.168.17.10]# /usr/sbin/logrotate -v -f /etc/logrotate.d/radiusd
reading config file /etc/logrotate.d/radiusd
Reading state from file: /var/lib/logrotate/logrotate.status
Allocating hash table for state file, size 64 entries
Creating new state
Creating new state
Creating new state
..
..
Creating new state
Handling logs
rotating pattern: /opt/freeradius/logs/*/detail forced from command line (4 rotations)
empty log files are not rotated, log files >= 524288000 are rotated earlier, old logs are removed
considering log /opt/freeradius/logs/*/detail
not running postrotate script, since no logs were rotated
[root@freeradius01 192.168.17.10]# ll
total 56919724
-rwxrwxrwx 1 root root 21048752215 Aug 14 23:59 detail-20240814
-rwxrwxrwx 1 root root 21617187765 Aug 15 23:59 detail-20240815
-rwxrwxrwx 1 root root 5988044800 Aug 16 23:59 detail-20240816
-rwxrwxrwx 1 root root 5947392 Sep 25 23:59 detail-20240925
-rwxrwxrwx 1 root root 7478423552 Oct 21 23:59 detail-20241021
-rwxrwxrwx 1 root root 1968389637 Oct 22 11:22 detail-20241022
[root@freeradius01 192.168.17.10]# grep "detail" /var/lib/logrotate/logrotate.status
"/var/log/radius/radacct/*/detail" 2024-3-5-3:0:0
"/opt/freeradius/logs/*/detail" 2024-3-5-3:0:0
[root@freeradius01 192.168.17.10]# date
Tue Oct 22 11:22:45 WAT 2024
[root@freeradius01 192.168.17.10]#
Então a rotação de log não está sendo executada apesar de eu tê-la executado manualmente / também os logs antigos não estão compactados!!?