Created
December 8, 2013 13:06
-
-
Save advancedxy/7857161 to your computer and use it in GitHub Desktop.
logrotate config file for mongodb
This file contains 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
/path/to/configsvr/config.log{ | |
weekly | |
rotate 9 | |
compress | |
size 100M | |
sharedscripts | |
create | |
postrotate | |
/bin/kill -SIGUSR1 `cat /path/to/configsvr/mongd.lock 2> /dev/null` 2> /dev/null || true | |
/bin/find /path/to/configsvr/ -type f -size 0 -regextype sed -regex ".*\.log\.[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}T[0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}" -delete 2> /dev/null | |
true | |
endscript | |
} | |
/path/to/mongos/mongos.log{ | |
weekly | |
rotate 9 | |
compress | |
size 100M | |
create | |
sharedscripts | |
postrotate | |
/usr/bin/pkill -SIGUSR1 mongos || true | |
/bin/find /path/to/mongos/ -type f -size 0 -regextype sed -regex ".*\.log\.[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}T[0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}" -delete 2> /dev/null | |
true | |
endscript | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment