Simple script to backup the helm db. It's quite old and I used it a long time ago.
@echo off
SET bkdir=d:\manualbackup\data
SET SAVEDATA="%bkdir%\helmdb.7z"
SET mysqldir=c:\mysql\bin
SET mysqlpassword=pass
REM 7-zip executable path
SET SEVENPATH="%PROGRAMFILES%\7-Zip\7z.exe"
SET zippass=pass
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
REM "%mysqldir%\mysqldump.exe" -u %mysqluser% -p%mysqlpassword% --opt --all-databases >"%bkdir%\backup.sql"
osql -E -S .\Helm -Q "BACKUP DATABASE helmdb TO DISK='%bkdir%\helmdb2.dat'"
if exist %bkdir%\helmdb2.dat goto exist
goto end
:exist
ren "%bkdir%\helmdb2.dat" helmdb.dat
%SEVENPATH% %ADDUP% -ms=off -p%zippass% -t7z %SAVEDATA% "%bkdir%\helmdb.dat"
del "%bkdir%\helmdb.dat" "%bkdir%\helmdb2.dat"
:end
Comments
Post a Comment