Friday, August 5, 2011

mysqldump

SkyHi @ Friday, August 05, 2011
@echo off

@echo Backing Up Server1
mysqldump -A -Q -R -c -e --lock-tables=FALSE -uXXXX -pXXXX -hX.X.X.1 > c:\backup\01.sql

@echo Backing Up Server2
mysqldump -A -Q -R -c -e --lock-tables=FALSE -uXXXX -pXXXX -hX.X.X.2  > c:\backup\02.sql

@echo Backing Up Server3
mysqldump -A -Q -R -c -e --lock-tables=FALSE-uXXXX -pXXXX -hX.X.X.3  > c:\backup\03.sql

set folderdate=%date:~7,2%-%date:~4,2%-%date:~10,4%
mkdir c:\backup\%folderdate%
set foldertime=%time:~0,2%-%time:~3,2%
mkdir c:\backup\%folderdate%\%foldertime%
move c:\backup\*.sql c:\backup\%folderdate%\%foldertime%\




@ECHO OFF
set folderdate=%date:~7,2%-%date:~4,2%-%date:~10,4%
move D:\seccam-data\0 D:\seccam-data\0_%folderdate%
mkdir D:\seccam-date\0


REFERENCES
http://www.robvanderwoude.com/datetiment.php#SetDate
http://forums.techguy.org/dos-other/79088-how-rename-folder-dos.html
http://twigstechtips.blogspot.com/2009/03/cant-change-directory-to-another-drive.html