Skip to content

Instantly share code, notes, and snippets.

@tvrcgo
Created February 5, 2015 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tvrcgo/cf8c5c6cd578a377ffa8 to your computer and use it in GitHub Desktop.
Save tvrcgo/cf8c5c6cd578a377ffa8 to your computer and use it in GitHub Desktop.
mongo sync for win
@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