平台有大量的图片已经不用了,数量级达到百万张,差不多100G的空间,放着不管是不是太浪费了?
复制代码 代码如下:
db.fs.files.find({filename:/xxx/}).forEach(function(n) {db.fs.files.update({filename:u.filename},{$set:{filename:newname}},false,true)}} //正则批量更改为固定名称,便于删除。
mongofiles -port 12345 -d xxx delete newname //mongofies根据filename批量干掉这些文件。
db.repairDatabase() //特别注意以上删除不是物理删除,chunks文件实际还在,show dbs 或者 db.stats() 发现db的size没有变化,要执行db.repairDatabase();另外注意这个动作是全局写锁,很耗内存和cpu的,而且处理时间跟文件数量大小有关,务必在非高峰期做。
差不多1个多小时后over, 舒坦了,100G空间啊!!!
Be aware that this command can take a long time to run if your database is large. In addition, it requires a quantity of free disk space equal to the size of your database. If you lack sufficient free space on the same volume, you can mount a separate volume and use that for the repair. In this case, you must run the command line and use the –repairpath switch to specify the folder in which to store the temporary repair files.
Warning:This command obtains a global write lock and will block other operations until it has completed.
更新日志
- 《QQ音乐 抖音热歌榜 225首 2024年第1季度.共计10期 TOP100》[FLAC/分轨][7.3GB]
- 天龙八部手游七周年 少侠集体走心庆生
- 西游笔绘西行红鳞大鳞技能介绍 技能效果一览
- 鸣潮桃祈阵容怎么搭配 最强阵容推荐
- dnf抗性怎么增加
- dnf护石可以分解吗
- dnf护石怎么合成
- 游侠晚报:《刺客信条影》预购火爆 IGN评最佳NS游戏
- 手办鉴赏室:妖精女王超帅气!阿尔托莉雅优雅战斗
- 《黑神话:悟空》将登陆WeGame!全新实机宣传片赏
- 白玛多吉《梦》限量1:1母盘直刻[低速原抓WAV+CUE]
- 林一峰2007-一期一会[香港首版][WAV+CUE]
- 林一峰2004-一个人在途上[LYFEMusic][WAV+CUE]
- 《黑神话:悟空》WeGame页面更新 删除D加密描述
- 《黑神话悟空》登热搜 网友:定价268元太良心了!