mysql dump and save with a batch file. It's quite old but works.
SET bkdir=d:\manualbackup\data
SET SAVEDATA="%bkdir%\mysql.7z"
SET mysqldir=c:\mysql\bin
SET mysqluser=root
SET mysqlpassword=pass
REM 7-zip executable path
SET SEVENPATH="%PROGRAMFILES%\7-Zip\7z.exe"
REM zipped file to save data
SET ADDUP=a
IF EXIST %SAVEDATA% SET ADDUP=u
@REM Change to mysqldir
CD %mysqldir%
@REM dump database. This is all one line
"%mysqldir%\mysqldump.exe" -u %mysqluser% -p%mysqlpassword% --opt --all-databases >"%bkdir%\backup.sql"
%SEVENPATH% %ADDUP% -ms=off -pfuxedboost -t7z %SAVEDATA% "%bkdir%\backup.sql"
del "%bkdir%\backup.sql"
Comments
Post a Comment