|
|
|
|
|
by chmac
6512 days ago
|
|
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. |
|