@echo off REM Дамп БД без таблиц и триггеров, только процедуры/функции setlocal enabledelayedexpansion SET DBHOST=localhost SET DBPORT= SET DBNAME=ukmserver SET DBUSER=root SET DBPASSWORD= SET BACKUPDRIVE=F: SET BACKUPDIR=backup\ukm if not "%1"=="" set DBHOST=%1 if not "%2"=="" set DBPASSWORD=%2 SET BACKUPNAME=%BACKUPDRIVE%\%BACKUPDIR%\%DBHOST%_%DBNAME% SET DBBACKUPFILE=%BACKUPNAME%-dump_procs.sql SET MYSQL_BIN=C:\mysql\bin\ echo === %0 starting work === echo = %DATE% %TIME% - DB dump echo ----------------------------------- echo DBHOST=%DBHOST% echo DBNAME=%DBNAME% echo DBUSER=%DBUSER% echo DBBACKUPFILE="%DBBACKUPFILE%" echo ----------------------------------- %BACKUPDRIVE% if NOT EXIST "%BACKUPDRIVE%\%BACKUPDIR%" md "%BACKUPDRIVE%\%BACKUPDIR%" cd "%BACKUPDRIVE%\%BACKUPDIR%" echo USE %DBNAME% > "%DBBACKUPFILE%" %MYSQL_BIN%\mysqldump.exe --no-create-db --no-create-info --no-data -R --triggers=FALSE --user=%DBUSER% --host=%DBHOST% --port=%DBPORT% --password=%DBPASSWORD% %DBNAME% >> "%DBBACKUPFILE%" if ERRORLEVEL 1 GOTO error echo = %DATE% %TIME% echo SUCCESS: %0 - backup complete echo =================================== exit /B 0 :error echo =================================== echo = %DATE% %TIME% echo ERROR: %0 - backup failed echo =================================== exit /B 1