sqldump

(coffee) => code

Simple logRotate Script for MongoDB

logRotate.js

1
db.getMongo().getDB("admin").runCommand("logRotate")

logRotate.sh

1
2
3
4
5
#!/bin/sh
# Clear old logs
rm /data/logs/mongod.log.*
# Rotate logs
mongo logRotate.js