Calling .bat file problem...
I wrote a script to backup some files for me automagically and to also call a .bat file that would backup my MySQL database.
Well, the file copying works great, but for some reason, it doesn't call the .bat file like it's supposed to. When I run the script manually, it works exactly as it should, but when it runs at 1 AM like I asked, it borks.
Here's the vbs:
Code:
dim dbcopy
dim mysqlbackup
dim foldername
foldername="C:\backup\"&weekdayname(weekday(date()))
set dbcopy=CreateObject("Scripting.FileSystemObject")
if dbcopy.FolderExists(foldername) then
dbcopy.DeleteFolder(foldername)
end if
dbcopy.CreateFolder(foldername)
dbcopy.CopyFile "C:\Inetpub\wwwroot\_private\*.*", foldername
set mysqlbackup=wscript.createobject("wscript.shell")
mysqlbackup.run("sqlbackup.bat "&weekdayname(weekday(date())))
And here's the contents of 'sqlbackup.bat':
Code:
@echo on
mysqldump -uxxx -pxxx sales > c:\backup\%1\sales.sql
As always, any assistance is greatly appreciated.
bryceowen, May 15th, 2009 10:57 AM
Bookmarks