Windows XP Community - XPHeads



mysql dump batch file stopped working.

microsoft.public.windowsxp.general


Reply
  #1 (permalink)  
Old 03-26-2008, 08:36 AM
Rob
 
Posts: n/a
mysql dump batch file stopped working.
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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-26-2008, 10:20 AM
Pegasus \(MVP\)
 
Posts: n/a
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"


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-26-2008, 10:06 PM
Rob
 
Posts: n/a
Re: mysql dump batch file stopped working.
I added that line like you suggested even though I'm positive both
directories exist. I still receive the same error.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-26-2008, 10:55 PM
Pegasus \(MVP\)
 
Posts: n/a
Re: mysql dump batch file stopped working.

"Rob" <me@nospam.com> wrote in message
news:%23UE%23q24jIHA.3400@TK2MSFTNGP03.phx.gbl...
>I added that line like you suggested even though I'm positive both
>directories exist. I still receive the same error.


Create a new batch file like so:
1. @echo off
2. for /f "tokens=1" %%i in ('date /t') do set DATE_DOW=%%i
3. for /f "tokens=2" %%i in ('date /t') do set DATE_DAY=%%i
4. for /f %%i in ('echo %date_day:/=-%') do set DATE_DAY=%%i
5. for /f %%i in ('time /t') do set DATE_TIME=%%i
6. for /f %%i in ('echo %date_time::=-%') do set DATE_TIME=%%i
7. dir "C:\Program Files\MySQL\MySQL Server 4.1\bin\mysqldump" >
c:\test.txt
8. echo D:\database backups\thefolder\"%DATE_DAY%_%DATE_TIME%_thedbnam e.sql
>> c:\test.txt

9. dir "D:\database
backups\thefolder\"%DATE_DAY%_%DATE_TIME%_thedbnam e.sql" >> c:\test.txt
10. dir "D:\databasebackups\thefolder\"%DATE_DAY%_%DATE_TI ME%_thedbname.sql"
>> c:\test.txt

11. notepad c:\test.txt
12. "C:\Program Files\MySQL\MySQL Server 4.1\bin\mysqldump" -u
theusername -p"thepassword" thedbname >"D:\database backups\thefolder\"%
DATE_DAY%_%DATE_TIME%_thedbname.sql

You must, of course, remove the line numbers. Their purpose is to
mark the start of each line. Note that Line 12 is a very long line.
Is there a space between "database" and "backups"?

Post the contents of c:\test.txt when it appears on your screen.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-27-2008, 03:17 AM
Rob
 
Posts: n/a
Re: mysql dump batch file stopped working.
Volume in drive C is 1
Volume Serial Number is 3C91-1527

Directory of C:\Program Files\MySQL\MySQL Server 4.1\bin


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:50 AM.


Registry Mechanic - Free Scan Now
Driver Scanner 2009 - Free Scan Now




Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74