Start a conversation

Vorratsdatenspeicherung mit Postfix und Logrotate

So aktivieren Sie die Vorratsdatenspeicherung auf unseren Debian Confixx Systemen.

Überprüfen Sie erstmal mit dem Befehl ps aux | grep cron ob der cron Dienst läuft.

Dann überprüfen Sie ob die Datei /etc/cron.daily/logrotate vorhanden ist, wenn nicht mit folgendem Inhalt anlegen:

#!/bin/sh
test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf

Danach entnehmt ihr auf der Datei /etc/logrotate.d/rsyslog diese Zeilen:

/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log

und erstellt eine neue Daten /etc/logrotate.d/mail mit dem folgende Inhalt:

/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log {
daily
copytruncate
rotate 186
compress
delaycompress
notifempty
dateext
create 640 root adm
}

In diesem Fall wird die Logdatei täglich Archiviert, die alte Logdatei auf Länge 0 abgeschnitten. Das Logarchiv wird 6 Monate im Dateisystem behalten  und aus dem Dateisystem gelöscht.

Mit dem Befehlt logrotate --force /etc/logrotate.conf könnt ihr das ganze dann testen.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Björn Strausmann (Migrated deleted Agent)

  2. Posted
  3. Updated

Comments