MySQL Backup to Amazon S3
18th Feb
Inspired by Alex King’s recent post on backups, I hacked together this short Perl script that will backup MySQL databases to Amazon’s excellent S3 storage system.
You can download it here. You will need to edit a few configuration items at the top of the script, to include your Amazon Web Services IDs and MySQL details. You will also need the Amazon::S3 and DBI perl modules. You can get them from CPAN.
$ wget -Omysql_s3.pl http://dparrish.com/files/mysql_s3.pl $ vi mysql_s3.pl (enter your details) $ chmod 755 mysql_s3.pl $ ./mysql_s3.pl
It’s probably best to add it to cron so it will run daily. Something like this works nicely:
0 3 * * * perl /home/dparrish/mysql_s3.pl
I’d also suggest using S3 Firefox Organizer to manage your S3 account. It’s a Firefox plugin.