News for hackers. Stuff that matters.
Re:CouchSurfing Deletes Itself, Shuts Down - Old, yet relevant by chmac on Sunday August 17, 2008 @03:14AM (#278242)
For a smaller database, dmpayton's suggestion is spot on. Simply cron schedule a mysqldump and then push that offsite. Here's a few example code snippets I use:

/usr/bin/mysqldump -u dbusername -pdbpassword --skip-lock-tables database_name | gzip > /path/to/backup/file/file_$(/bin/date +\%Y-\%m-\%d_\%H-\%M-\%S).sql.gz

I'm using --skip-lock-tables because on a ZenCart site, the lock tables option was adversely affecting site performance.

Then you could add something to automatically email or scp the file to another host.

For bigger, more complex databases, look into MySQL binary logging, DRBD replication, and MySQL slaves. That should give you some keywords to get started.

Re:CouchSurfing Deletes Itself, Shuts Down - Old, yet relevant by shafqat on Sunday August 17, 2008 @05:06PM (#278603)
Thanks this is exactly what we are doing... (the first option).