-
-
Save u007/b3a28f94da97d4fcb4af539cd26c74c1 to your computer and use it in GitHub Desktop.
logrotate configuration example
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
# /etc/logrotate.d/web | |
# me = my username | |
# with max of 10MB | |
/home/me/web/log/production.log { | |
size 10M | |
copytruncate | |
create 0666 me | |
compress | |
rotate 4 | |
missingok | |
} | |
# To test | |
# sudo logrotate /etc/logrotate.d/web | |
# use -f flag to force run (even if size is below 10MB) | |
# ensure /home/me/web/log (parent directory) does not have group+other writable: chmod go-w log | |
# also log/production.log must be owned by "me" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment