Skip to content

Instantly share code, notes, and snippets.

@nicgrayson
Created November 18, 2013 15:36
Show Gist options
  • Save nicgrayson/7529828 to your computer and use it in GitHub Desktop.
Save nicgrayson/7529828 to your computer and use it in GitHub Desktop.
## recipes/default.rb
template "/etc/logrotate.d/rsyslog" do
owner "root"
group "root"
mode 0515
end
## templates/default/rsyslog
var/log/syslog
{
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
reload rsyslog >/dev/null 2>&1 || true
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 4
weekly
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
restart rsyslog >/dev/null 2>&1 || true
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment