.@csharpfritz, @jptoto If you are using EC2 EBS volumes and not taking regular snapshots, you are not being backed up…
Amazon EBS snapshots are awesome. You can take snapshots to backup your database, quickly move data between staging and production, run analytics on the latest data, resize volumes and much more.
For Apartly, I’m using MySQL, storing data and log files on a mounted EBS volume. EBS offers persistent, reliable storage (with replication for fault tolerance). Still, nothing can prevent data from disappearing, hence backups.
The current setup uses a cron task that runs hourly and creates a snapshot of the EBS volume. It’s a simple procedure involving flushing, locking, and synching, and you can read all about it here. If the database goes catastrophical, I can always go back in history.
Since you don’t want to accumulate snapshots until the end of time (storage is not free), the script keeps hourly snapshots from the past 24 hours and daily snapshots from the past week, and discards the rest.
It’s a very simple script, based on Eric Hammond’s excellent ec2-consistent-snapshot. Notable differences:
- Using Ruby (tested for 1.9.1 only) instead of Perl. (Mind you, they’re both Unix)
- Discards old snapshots, only keep hourly from last 24 hours and daily for past 7 days.
- Get it: wget http://bit.ly/PTR9K
- Edit settings, then drop into /etc/cron.hourly
Enjoy.