Created
April 9, 2018 17:02
-
-
Save mnebuerquo/8c980e7267b984d7e5748da1686c6f8e to your computer and use it in GitHub Desktop.
logrotate rule to rotate mongodb logs
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
# rotate mongodb | |
# https://stackoverflow.com/a/8396266/5114 | |
/var/log/mongo/*.log { | |
daily | |
rotate 30 | |
compress | |
dateext | |
missingok | |
notifempty | |
sharedscripts | |
copytruncate | |
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