common: limit syslog retention to 7 days

This commit is contained in:
Markus 2020-02-02 20:57:28 +01:00
parent d97524798b
commit f184ca15fe
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,37 @@
/var/log/syslog
{
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}
/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log
/var/log/daemon.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/lpr.log
/var/log/cron.log
/var/log/debug
/var/log/messages
{
rotate 7
daily
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}

View File

@ -63,3 +63,8 @@
regexp: "^#?MaxRetentionSec=.*"
line: "MaxRetentionSec=7day"
notify: Restart journald
- name: Configure log retention
copy: src={{ item }} dest=/etc/logrotate.d/{{ item }}
with_items:
- rsyslog