1、编写js脚本
db.runCommand({logRotate:1})
2、编写windows批处理
mongo -u root -p root -authenticationDatabase admin localhost/admin "D:Program FilesMongoDBServer3.2dataackuplogRotate.js"
3、建立计划任务,定时执行
注:如果是linux系统下编写sh脚本即可
1、编写js脚本
db.runCommand({logRotate:1})
2、编写windows批处理
mongo -u root -p root -authenticationDatabase admin localhost/admin "D:Program FilesMongoDBServer3.2dataackuplogRotate.js"
3、建立计划任务,定时执行
注:如果是linux系统下编写sh脚本即可