Linux Debian, Begrenzung der Größe von Protokolldateien, Beispiel: syslog
Diese Datei bearbeiten: /etc/logrotate.d/rsyslog
sudo nano /etc/logrotate.d/rsyslog
So einstellen:
/var/log/syslog
/var/log/mail.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/cron.log
{
rotate 7
size 200M
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}
Die Einträge: /var/log/* stehen für alle Dateien, die betroffen sind.
Anschließend neu starten:
sudo systemctl restart rsyslog
Testen Sie anschließend Ihre Konfiguration:
sudo logrotate -v /etc/logrotate.conf
Lädt...