Diese Konfiguration nutze ich für iptables. Dabei liegen die angelegten Logfiles unter „/var/log/iptables/“. Die Konfiguration des Speicherortes passiert in der iptables-Konfiguration.
/var/log/iptables/*.log {
daily
missingok
rotate 90
compress
dateext
notifempty
create 640 root adm
olddir /var/log/iptables/old/
}
Das Verzeichnis für die alten Logs muss manuell angelegt werden.
Zur Überprüfung der Konfiguration sollte man diese testen:
/usr/sbin/logrotate -d /etc/logrotate.d/iptables
Dann müsste ungefähr folgendes erscheinen:
/usr/sbin/logrotate -d /etc/logrotate.d/iptables reading config file /etc/logrotate.d/iptables reading config info for /var/log/iptables/*.log olddir is now /var/log/iptables/old/ Handling 1 logs rotating pattern: /var/log/iptables/*.log after 1 days (90 rotations) olddir is /var/log/iptables/old/, empty log files are not rotated, old logs are removed considering log /var/log/iptables/accept.log log does not need rotating considering log /var/log/iptables/drop.log log does not need rotating