Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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