Last active
July 13, 2022 14:10
-
-
Save mattantonelli/e8317dba141b7dc8179cfccfca23220c to your computer and use it in GitHub Desktop.
logrotate configurations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NGINX from source | |
/opt/nginx/logs/*.log { | |
su nginx nginx | |
weekly | |
dateext | |
dateformat .%Y-%m-%d | |
rotate 3 | |
compress | |
delaycompress | |
create 0640 nginx nginx | |
sharedscripts | |
postrotate | |
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid` | |
endscript | |
} | |
# Standard NGINX from yum | |
/var/log/nginx/*log { | |
create 0664 nginx root | |
daily | |
rotate 10 | |
missingok | |
notifempty | |
compress | |
sharedscripts | |
postrotate | |
/bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true | |
endscript | |
} | |
# Rails application | |
/var/rails/myapp/shared/log/*.log { | |
su nginx nginx | |
weekly | |
dateext | |
dateformat .%Y-%m-%d | |
rotate 3 | |
compress | |
delaycompress | |
copytruncate | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment