Created
August 10, 2015 07:42
-
-
Save blacktambourine/5ba28545a856c171ce09 to your computer and use it in GitHub Desktop.
Backup a Windows based Mongo DB
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 | |
for /f "tokens=1-4 delims=/ " %%i in ("%date%") do ( | |
set dow=%%i | |
set month=%%j | |
set day=%%k | |
set year=%%l | |
) | |
set datestr=%month%_%day%_%year% | |
echo datestr is %datestr% | |
C:\mongodb\bin\mongodump --out C:\MongoDBBackup\%datestr% | |
echo Mongo DB Backup Complete. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment