Skip to content

Instantly share code, notes, and snippets.

@elmariofredo
Forked from srpouyet/mongodb
Created May 22, 2014 17:10
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 elmariofredo/ace67ea92f226d96b115 to your computer and use it in GitHub Desktop.
Save elmariofredo/ace67ea92f226d96b115 to your computer and use it in GitHub Desktop.
# Put this in /etc/logrotate.d/mongodb
# http://stackoverflow.com/questions/5004626/mongodb-log-file-growth
/var/log/mongo/*.log {
daily
rotate 30
compress
dateext
missingok
notifempty
sharedscripts
postrotate
/bin/kill -SIGUSR1 `cat /var/lib/mongo/mongod.lock 2> /dev/null` 2> /dev/null || true
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment