Ruby and MySQL backup

I suspect this is not exactly a Ruby/Rails topic but I also suspect that lots of people here have already solved this issue. We have a simple app running on a SliceHost slice and we'd like to backup the database both hourly and daily to an AWS S3 account. I've looked around but surprisingly can't seem to find anything that offers a complete solution for doing this. I was hoping to find a ruby solution but so far nothing. I suspect that it's not a super hard thing to do but it's not really my specialty so I was hoping someone here might simply point me in the right direction - perhaps a blog post or something similar.

Dale

PeteSalty wrote:

I suspect this is not exactly a Ruby/Rails topic but I also suspect that lots of people here have already solved this issue. We have a simple app running on a SliceHost slice and we'd like to backup the database both hourly and daily to an AWS S3 account. I've looked around but surprisingly can't seem to find anything that offers a complete solution for doing this. I was hoping to find a ruby solution but so far nothing. I suspect that it's not a super hard thing to do but it's not really my specialty so I was hoping someone here might simply point me in the right direction - perhaps a blog post or something similar.

Dale

You could setup a cron job to do it as you mentioned [mysqldump]. You could try a mysql table syncer http://code.google.com/p/ruby-roger-useful-functions/wiki/TableSyncer Cheers. -=r

I always use automysqlbackup (AutoMySQLBackup download | SourceForge.net). It's not ruby, but it's damn fine for backing up MySQL especially if you need to backup several databases on the same server.

I use my own bash Shell script. It commits all the database dumps to a git repository and then pushes it to a central repository (but the script could just as easily be modified to use svn or mercurial or …). That way you have versioned backups both on the local machine as on a remote host (or hosts even) going back as far as you want. Then just let a cron take care of executing the script as frequently as you want.

http://pastie.org/293699

Best regards

Peter De Berdt

Thanks a lot Peter!