Skip to content

Instantly share code, notes, and snippets.

@teddychan
Created May 8, 2015 17:41
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 teddychan/e03311114ee9400f913b to your computer and use it in GitHub Desktop.
Save teddychan/e03311114ee9400f913b to your computer and use it in GitHub Desktop.
/log/mongod.log {
daily
rotate 20
missingok
compress
delaycompress
notifempty
dateformat .%Y-%m-%dT%s
create 640 mongod mongod
sharedscripts
postrotate
/bin/kill -SIGUSR1 `cat /var/run/mongodb/mongod.pid 2>/dev/null` >/dev/null 2>&1
find /log -type f -size 0 -regextype posix-awk -regex "^\/log\/mongod\.log\.[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}-[0-9]{2}-[0-9]{2}$" -execdir rm {} \; >/dev/null 2>&1
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment