Skip to content

Instantly share code, notes, and snippets.

@u007
Last active July 9, 2018 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save u007/b3a28f94da97d4fcb4af539cd26c74c1 to your computer and use it in GitHub Desktop.
Save u007/b3a28f94da97d4fcb4af539cd26c74c1 to your computer and use it in GitHub Desktop.
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