Skip to content

Instantly share code, notes, and snippets.

@fiunchinho
Created June 2, 2013 22:08
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 fiunchinho/5695140 to your computer and use it in GitHub Desktop.
Save fiunchinho/5695140 to your computer and use it in GitHub Desktop.
Rotate mongo logs every week
# /etc/logrotate.d/mongod
# http://linuxcommand.org/man_pages/logrotate8.html
/var/log/mongodb/mongodb.log {
weekly
missingok
rotate 30
compress
dateext
notifempty
sharedscripts
postrotate
/bin/kill -SIGUSR1 `cat /var/lib/mongodb/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