同步
echo off set time_dir=%date:~0,4%-%date:~5,2%-%date:~8,2% set bak_dir=mongo_na_world_svn2win_%time_dir% set mongo_dir=E:MongoDbmongodb-win32-i386-2.2.3 set fromdb=db_eragon_game_na_world %mongo_dir%inmongodump.exe -h 192.168.102.237 -d %fromdb% -o %bak_dir% mkdir tmp_dir xcopy %bak_dir%\%fromdb%cf_* tmp_dir %mongo_dir%inmongorestore.exe -h 192.168.102.237 -d db_eragon_game_na_world_w0 --drop --directoryperdb tmp_dir %mongo_dir%inmongorestore.exe -h 192.168.102.237 -d db_eragon_game_na_world_w1 --drop --directoryperdb tmp_dir rd /s/q tmp_dir rd /s/q %bak_dir% pause
备份
echo off set time_dir=%date:~0,4%-%date:~5,2%-%date:~8,2% set bak_dir=temp_mongo_na_world_win2dev_%time_dir% set mongo_dir=E:MongoDbmongodb-win32-i386-2.2.3 set fromdb=db_eragon_game_na_world_w0 %mongo_dir%inmongodump.exe -h 192.168.102.237 -d %fromdb% -o %bak_dir% mkdir mongo_na_world_win2dev_dir_%time_dir% xcopy %bak_dir%\%fromdb%cf_* mongo_na_world_win2dev_dir_%time_dir% rd /s/q %bak_dir% pause