logrotate configuration example
# /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