Skip to content

Instantly share code, notes, and snippets.

@brainwire
Forked from iamdbc/logrotate-puma-rails
Created July 7, 2019 09:50
Show Gist options
  • Save brainwire/69b971c89145c75faa445c1fb11b6adc to your computer and use it in GitHub Desktop.
Save brainwire/69b971c89145c75faa445c1fb11b6adc to your computer and use it in GitHub Desktop.
logrotate for puma on rails
# file location: /etc/logrotate.d
/sitesroot/domain/logfolder/*.log {
su deploy deploy
daily
rotate 7
missingok
dateext
compress
notifempty
sharedscripts
postrotate
[ -e /tmp/pids/puma.pid ] && kill -HUP `cat /tmp/pids/puma.pid` && kill -USR1 `cat /tmp/pids/puma.pid`
endscript
}
# kill -HUP reopen puma.*.log
# kill -USR1 reopen production.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment