If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > trying to schedule a task for backing up database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-09-11, 15:52
gib65 gib65 is offline
Registered User
 
Join Date: Nov 2011
Posts: 9
trying to schedule a task for backing up database

I'm trying to schedule a task in Windows Server 2003 to backup my database once a day.

According to this website: How to use Schtasks.exe to Schedule Tasks in Windows Server 2003, I should be able to type something like the following at a command prompt:

schtasks /create /tn "mysqldump" /tr "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump.exe -u*** -p*** gibsdb > gibsdb_backup.sql" /sc daily /st 18:00:00 /ed 12/31/2020

I type that in and it tells me that the task has been successfully created. But when I look in the bin folder for my backup file gibsdb_backup.sql after the specified time, it's not there.

Any suggestions as to why not?
Reply With Quote
  #2 (permalink)  
Old 11-09-11, 16:39
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,606
Check the task to see what happended.

-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
  #3 (permalink)  
Old 11-10-11, 02:47
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 620
From a UNIX/Linux perspective when you schedule a job it is not known what the current working directory is. The recommendation is always to use a full path name when redirecting the output. Also instead of redirecting you should use the -r (--result-file=) option which outputs the results into that file. Again make sure you use a full pathname.
__________________
Ronan Cashell
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
  #4 (permalink)  
Old 11-10-11, 19:04
gib65 gib65 is offline
Registered User
 
Join Date: Nov 2011
Posts: 9
Quote:
Originally Posted by Pat Phelan View Post
Check the task to see what happended.

-PatP
The only way I know how to do that is to type "schtasks /query" and that gives me:

C:\Program Files\MySQL\MySQL Server 5.1\bin>schtasks /query

Code:
TaskName                             Next Run Time            Status
==================================== ======================== ===============
mysqldump                            6:00:00 PM, 11/9/2011    Could not start
website backups                      5:05:00 PM, 11/9/2011
So all it tells me is that it couldn't start.

I understand there's supposed to be a SchedLgU.txt log file somewhere but I searched for it and couldn't find it. I'm told it's supposed to be under C:\Windows but it isn't.

Any way to probe into this further?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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