It is possible to do logrotate without restarting nginx (just send USR1 signal to nginx it will do the job). I wonder it is possible for my rails app (nginx passenger). It's not worth to restart my rails apps just to do a logrotate.
logrotate configuration is pretty simple to get this down
/path/to/rails_apps/*/shared/log/*.log {
daily
missingok
rotate 30
compress
delaycompress
copytruncate
}
the copytruncate
basically copies the content to new file and truncates the old file. this eliminates the need for restart.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With