Compress maillogs on bastion hosts/mail hubs with xz and keep 14 days of them.
This commit is contained in:
parent
e99af90192
commit
c0c992ede7
2 changed files with 32 additions and 0 deletions
24
roles/packager_alias/files/syslog
Normal file
24
roles/packager_alias/files/syslog
Normal 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
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue