Skip to content

Instantly share code, notes, and snippets.

@joe1chen
Forked from srpouyet/mongodb
Last active August 29, 2015 14:06
Show Gist options
  • Save joe1chen/4ac0bdc817cd872b9d88 to your computer and use it in GitHub Desktop.
Save joe1chen/4ac0bdc817cd872b9d88 to your computer and use it in GitHub Desktop.
# Put this in /etc/logrotate.d/mongodb
# http://stackoverflow.com/questions/5004626/mongodb-log-file-growth
/log/*.log {
daily
rotate 30
compress
dateext
missingok
notifempty
sharedscripts
postrotate
/bin/kill -SIGUSR1 `cat /data/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