Mysql Day wise Backup

I am using Windows 7 System. My Mysql is installed into D: . It is done simple using a Batch file. Batch file will call automatically using scheduler etc. In my batch file d:\DB_Backup is the Backup Directory. We are creating current dated folder Into DB_Backup folder and create .sql file into current dated folder.

for /f "tokens=1-4 delims=/ " %%a in ('Date /t') do (
set Month=%%b
set Day=%%c
set Year=%%d
set DATES=%Day%-%Month%-%Year%
cd d:\DB_Backup
mkdir %DATES%

cd D:\wamp\bin\mysql\mysql5.5.24\bin
mysqldump -uroot -proot1234 database1 > d:\DB_Backup\%DATES%\database1.sql 

We can fallow the same way for linux or other system.

Leave a Reply

Your email address will not be published. Required fields are marked *

Result of *Captcha loading...