Created
February 5, 2015 16:27
-
-
Save tvrcgo/cf8c5c6cd578a377ffa8 to your computer and use it in GitHub Desktop.
mongo sync for win
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
if "%1" == "" goto nohost | |
if "%2" == "" goto nodb | |
:sync | |
mongodump --host %1 --db %2 | |
mongorestore --db %2 --drop dump/%2 | |
:dropdump | |
del/s/q .\dump | |
rd/s/q .\dump | |
goto done | |
:nodb | |
echo not specify sync db | |
goto done | |
:nohost | |
echo not specify remote sync host | |
goto done | |
:done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment