Created
April 11, 2016 15:12
-
-
Save jorgedison/fd490092848343ec5ef29b09a1cb9f83 to your computer and use it in GitHub Desktop.
Batch Backup Database mysql
This file contains 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 | |
SET HOUR=%time:~0,2% | |
SET dtStamp9=%date:~-4%%date:~4,2%%date:~7,2%_0%time:~1,1%%time:~3,2%%time:~6,2% | |
SET dtStamp24=%date:~-4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2% | |
if "%HOUR:~0,1%" == " " (SET dtStamp=%dtStamp9%) else (SET dtStamp=%dtStamp24%) | |
ECHO %dtStamp% | |
c: | |
cd "C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin" | |
mysqldump.exe --user=root --password= sunedu_hd > D:\Backup\iTop\sunedu_hd_%dtStamp%.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment