Created
February 29, 2012 17:14
-
-
Save srpouyet/1942579 to your computer and use it in GitHub Desktop.
Mongodb logrotate on Ubuntu
This file contains hidden or 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
# 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
on ubuntu 12.04 with mongodb 2.4.3 you should change your path for the logs and lock files :