当前位置:Gxlcms > 数据库问题 > MongoDB实现日志自动切割

MongoDB实现日志自动切割

时间:2021-07-01 10:21:17 帮助过:5人阅读

1、编写js脚本

db.runCommand({logRotate:1})

2、编写windows批处理

mongo -u root -p root -authenticationDatabase admin localhost/admin "D:\Program Files\MongoDB\Server\3.2\data\backup\logRotate.js"

 3、建立计划任务,定时执行

注:如果是linux系统下编写sh脚本即可

MongoDB实现日志自动切割

标签:lin   roo   god   and   ram   sha   arp   root   host   

人气教程排行