|
Re: mysql dump batch file stopped working.
"Rob" <Rob@nospam.com> wrote in message
news:u9KkFyxjIHA.1188@TK2MSFTNGP04.phx.gbl...
> Hello,
> I had someone make a batch file for me that would backup mysql db and
> recently it stopped working and I don't know the cause and how to fix it.
> The bat file has not changed so it must have been a system change.
>
> The error I get is right after the dump code and it says
> The system cannot find the path specified. As I mentioned I can't remember
> editing the batch file and the path definitely exists cine I can manually
> navigate to the directory in the command prompt.
>
> REM @echo off
>
> for /f "tokens=1" %%i in ('date /t') do set DATE_DOW=%%i
>
> for /f "tokens=2" %%i in ('date /t') do set DATE_DAY=%%i
> for /f %%i in ('echo %date_day:/=-%') do set DATE_DAY=%%i
> for /f %%i in ('time /t') do set DATE_TIME=%%i
> for /f %%i in ('echo %date_time::=-%') do set DATE_TIME=%%i
> "C:\Program Files\MySQL\MySQL Server 4.1\bin\mysqldump" -u
> theusername -p"thepassword" thedbname >"D:\database
> backups\thefolder\"%DATE_DAY%_%DATE_TIME%_thedbnam e.sql
>
> Thanks
>
There are two path references in the script and you must check
both of them:
C:\Program Files\MySQL\MySQL Server 4.1\bin
and
D:\database backups\thefolder
To make the script more robust, you should add this line right
att the start:
@echo off
if not exist "D:\database backups\thefolder" md "D:\database
backups\thefolder"
|