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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best Way To Backup To A Local Machine?

Status
Not open for further replies.

3dColor

Programmer
Jan 10, 2006
240
US
I would like to schedule nightly backups of my database from my web host to my local machine, but I am not sure the best way.

I have been trying unsuccessfully today to use MySQL Admin with Vista Task Scheduler.

The thought is I use Vista Task Scheduler on my local machine to run MySQL Admin at night right before MySQL Admin runs it's scheduled backup.

But I can't figure out how to get the Task Scheduler to connect to the database after it starts the MySQL Admin program.
 
I use this on Linux, but it should work on the other OS.

Schedule this to backup...

Code:
mysqldump --add-drop-table --extended-insert --quick --host=server_name_or_ip --user=db_username --password=db_password database_name > ./db_file.sql

This is the restore...

Code:
mysql -udb_username -pdb_password database_name < ./db_file.sql

I use it in conjunction with php and/or shell scripts to give the db_file.sql a date/time stamp. Then I also do the cleanup from the script.

Mark
 
Mark,

What shell scripts do you like to use for this. Would AutoIt work?
 
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