auto database backup

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
frustratednewguy
Forum Newbie
Posts: 2
Joined: Sat Mar 20, 2004 1:15 pm

auto database backup

Post by frustratednewguy »

Is there a way to backup a database automatically, ie: if there are any changes to a table, a CSV file is automatically emailled to you?
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

you could make a function and put it in update/insert etc sections of your site, which after changeing the database, would email you the csv.

or you can just setup a cron job, if you dont have this option then make a file with timstamp in it, check that file every X hours when changeing the db and if the stamp is older then 5 hours for example, it would email you the csv and update stamp in the file, you can also make a table in db for this.
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

Post by lostboy »

also consider what kind of application and table types you have. innodb backups need more effort and parts. Note its always best to do a cold back up where the server is shut down (though a 24/7 operation may not have the ability to shutdown to do backups). Replication to anther server might also be a process that you can consider...

Get this book. High Perfomance Mysql talks about all sorts of factors like this...great read and well written
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

nice book suggestion lostboy, i ordered it for £19.95 :D

thanks
Post Reply