0
I've created a batch file to create a dump of a database and save it in a file with the current date as part of the file name. The batch file works brilliantly and all the data is saved correctly.
I've now tried to set up a scheduled task to do this weekly, but I've run into a problem: although the task runs, the file it creates is empty, as if it has not pulled any data from the remote database. I know it's pretty vague, but can anybody tell where I'd start looking for a reason/solution?
** EDIT **
Right, more progress - looks like it might be a path problem I've put a pause in the batch file, and when run through the task scheduler, it says:'mysqldump is not a recognized program'. However when run through the command line on my user account it works fine; just to confirm, I've set it run on the same user account I've been testing it on.
** EDIT 2 **
I've found a sort of solution: I've had to refer the mysqldump application by its absolute path. However I still can't understand why it can find mysqldump from the path when run directly from the command line, but not when automated through the task scheduler.
its not a network problem, i can run the entire batch file from the command line and it works ok, and i get the same problem trying to back up from my local mysql server – richzilla – 2010-11-01T22:56:27.780
yep this is the problem, it is in the path. in the path ive got
c:\xampp\mysql\bin\
where bin contains all of the mysql binaries. when running the batch file from the command line, i just need to refer to the application name -mysqldump
. When running from the task scheduler, it refuses to work unless i provide the batch file with the full path tomysqldump.exe
– richzilla – 2010-11-01T23:46:28.233