Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2011
    Posts
    13

    Unanswered: 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?

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Check the task to see what happended.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    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
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

  4. #4
    Join Date
    Nov 2011
    Posts
    13
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •