Skip to content

Instantly share code, notes, and snippets.

@goodfeel
Created April 6, 2015 02:15
Show Gist options
  • Save goodfeel/a6b0f7345f0f082c857a to your computer and use it in GitHub Desktop.
Save goodfeel/a6b0f7345f0f082c857a to your computer and use it in GitHub Desktop.
Logrotate - Chef Rails
cd /var/log
sudo mkdir rails
sudo chown ec2-user:ec2-user rails
# /etc/logroate.conf
# Rotate weekly and when reached 52 rotations, notify or remove
# compress to .gz with delaycompress (compress will be done on next round of logrotation)
# ignore size 0 file
# copytruncate so we don't need to restart unicorn.
/var/www/XXX/shared/log/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
copytruncate
olddir=/var/log/rails/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment