@echo off
@title MongoDB备份脚本
@color 2F
echo ---------- 开始执行 MongoDB 数据库备份 ----------

rem MongoDB tool directory.
set dumpDir=D:\MongoDB\bin

rem backup path.
set targetDir=F:\data

if not exist %targetDir% (md %targetDir%)

%dumpDir%\mongodump.exe -h 127.0.0.1:27017 -d Petersons      -o  %targetDir%
%dumpDir%\mongodump.exe -h 127.0.0.1:27017 -d PanGu          -o  %targetDir%
%dumpDir%\mongodump.exe -h 127.0.0.1:27017 -d test           -o  %targetDir%

if ERRORLEVEL 0 echo ---------- MongoDB 数据库备份成功 ----------

@echo on
pause

 

相关文章:

  • 2021-04-02
  • 2022-01-11
  • 2021-11-27
  • 2021-11-27
  • 2021-11-27
  • 2021-12-30
  • 2021-04-30
  • 2021-05-31
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
  • 2021-07-14
相关资源
相似解决方案