Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I Have Task Scheduler Hit Enter For Me? 1

Status
Not open for further replies.

3dColor

Programmer
Joined
Jan 10, 2006
Messages
240
Location
US
I am trying to schedule nightly backup of my MySQL database using MySQL Administrator.

To start MySQL Administrator running at 2 in the morning I am using Task Scheduler in Vista.

I can get it running just fine, but I need it to click OK or enter for me once MySQL Administrator starts and I can't figure out how to do that using the Actions or Triggers tab.

Anyone know how to do this?
 
If the program takes command line arguments, you can supply these arguments in the Add arguments (optional) text box in Task Scheduler. Does your program have any command line parameter to avoid the message prompt that you are seeing, a sort of silent running command?

Have you tried the MySQL forums here?
 
I did try adding arguments because it sounded like MySQL takes them.

I think I was close with the following arguement such as:
-cnameofdatebase. I am not sure what the "-c" part does but I does start it running but not in the normal way and uses a ton of resource when it does.

Should I post this question in the other forum, would that be OK?
 
Of course it is OK to post in other Tek-Tips forums at the same time, it is plain good sense. It is also OK to look at other forums (which I saw that you have already done so while I was Googling for a possible solution).

When you find an answer, do post back here, as that may help the next reader of this thread who may have a similar problem.

One question I wanted to ask you, but as I am not a user of the MySQL programs I wasn't sure how to ask, but I will now anyway. The question was does MySQL have its' own Backup and Scheduling (starting time) tool, or just a Backup tool?
 
It has it's own Backup and Scheduling tool, but it needs to be running and connected to the right database.

If i find an answer i will post it here. I spent way too much time trying to find an answer yesterday.
 
Could you not look into using Scriptit?

Simon

The real world is not about exam scores, it's about ability.

 
SimonDavies,

Thanks for your suggestion. I have it mostly working but I can't figure out how to close MySQL Admin with AutoIt after the backup is done. Can you see what I am doing wrong?

Here is my code:

Code:
;
; AutoIt Version: 3.0
; Language:       English
; Platform:       Win9x/NT
; Author:         Dave Dugdale
;
; Script Function:
;   Opens MySQL Administrator 1.2.15 and allows a backup of the rv db to my local machine.
;

; This script requires full Administrative rights
#requireadmin


; Run the MySQL Administrator 
Run("C:\Program Files\MySQL\MySQL Tools for 5.0\MySQLAdministrator.exe")


; Wait for the MySQL Administrator become active
WinWaitActive("MySQL Administrator 1.2.15")


; Now that the MySQL Admin window is active Click OK Button sleep for 15 minutes 900000
Send("{ENTER}")
Sleep(900000) 


; Now quit by sending a "close" request to the MySQL Administrator
WinClose("MySQL Administrator 1.2.15")


; Now wait for MySQL Administrator to close before continuing
WinWaitClose("MySQL Administrator 1.2.15")


; Finished!
 
I figured out how to use MySQL Admin to do this with the task scheduler. My issue was a bad password.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top