Compress maillogs on bastion hosts/mail hubs with xz and keep 14 days of them.

This commit is contained in:
Kevin Fenzi 2016-05-26 14:08:13 +00:00
parent e99af90192
commit c0c992ede7
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,24 @@
/var/log/cron
/var/log/messages
/var/log/secure
/var/log/spooler
{
missingok
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}
/var/log/maillog {
daily
rotate 14
missingok
ifempty
compress
compresscmd /usr/bin/xz
uncompresscmd /usr/bin/xz
compressext .xz
dateext
sharedscripts
copytruncate
}

View file

@ -11,3 +11,11 @@
tags:
- install
#
# Since this host has mail aliases, it's a mail hub. Compress logs since there will be a ton of them
#
- name: install modified logrotate syslog script to compress maillog on mailhub
copy: src=syslog dest=/etc/logrotate.d/syslog owner=root group=root
tags:
- install