Skip to content

Instantly share code, notes, and snippets.

@kyledrake
Created March 19, 2012 17:13
Show Gist options
  • Save kyledrake/2119737 to your computer and use it in GitHub Desktop.
Save kyledrake/2119737 to your computer and use it in GitHub Desktop.
How to rotate logs with Rainbows!
# Put this in a logrotate file (like /etc/logrotate.d/yourcompany):
/var/log/yourcompany/website.log
{
daily
rotate 7
compress
missingok
notifempty
sharedscripts
size 5M
create 644 youruser yourgroup
postrotate
/bin/kill -USR1 `cat /var/run/yourcompany/website.pid 2>/dev/null` 2> /dev/null || true
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment