From 74e22e9d7377e1a275066a6f561f5955b0a80d18 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Fri, 12 Mar 2010 10:28:07 -0500 Subject: [PATCH] logRotate command to rotate logs SERVER-740 --- db/dbcommands_admin.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/db/dbcommands_admin.cpp b/db/dbcommands_admin.cpp index c9c0dc97874..2d0da537583 100644 --- a/db/dbcommands_admin.cpp +++ b/db/dbcommands_admin.cpp @@ -376,6 +376,17 @@ namespace mongo { } } fsyncCmd; - + + class LogRotateCmd : public Command { + public: + LogRotateCmd() : Command( "logRotate" ){} + virtual LockType locktype(){ return NONE; } + virtual bool slaveOk(){ return true; } + virtual bool adminOnly(){ return true; } + virtual bool run(const char *ns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool fromRepl) { + rotateLogs(); + } + + } logRotateCmd; }