Created
July 5, 2017 21:30
-
-
Save stevebauman/5d1387042b467712307e03c0cd934049 to your computer and use it in GitHub Desktop.
MySQL Windows Server Backup Script
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 Starting Backup. | |
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set dt=%%c-%%a-%%b) | |
For /f "tokens=1-4 delims=:." %%a in ('echo %time%') do (set tm=%%a%%b%%c%%d) | |
set database=database | |
set username=root | |
set password=password | |
set file=%database%-%dt%-%tm%.sql | |
echo Backing up to file: %file% | |
mysqldump --routines -u %username% -p%password% %database% > E:\Backups\%file% | |
echo Backup Complete! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment