[ec2] Script of rolling EBS volume snapshots?

Eric Hammond ehammond at thinksome.com
Tue Jun 23 03:54:43 BST 2009


I've had almost a year to enhance and fine tune the original, simplistic
EBS snapshot script I posted in this tutorial:

Doing hourly snapshots in multiple production environments I have
experienced all kinds of different failure modes and edge case
conditions on master and slave databases and on EBS volumes without

Through all this, the snapshot software has been refined locally into
something that is pretty robust and flexible with a number of tricks to
avoid interfering with the live operation of a production system.

I'm going to be publishing the code soon, but if you want a preview
copy, drop me a line.  I would appreciate feedback from others who can
test it in their own environments.

Eric Hammond
ehammond at thinksome.com

Roger Marshall wrote:
> On 22 Jun 2009, at 15:15, Jeffrey Greenberg wrote:
>> I'm looking for a script to be run from cron to create EBS snapshots
>> on a periodic basic (daily or hourly), and then to remove them after X
>> number of days (say 10 days).   It would also be useful to be able to
>> move a weekly snapshot to S3...
>> Is there such a script around? 
>> One challenge is that snapshots names are controlled by the ec2
>> snapshot code, rather than being meaningful to us...
>> Another is, any good code for doing the date math to figure out if X
>> days have elapsed on a file or arbitrary date string.
>> thanks,
>> Jeffrey Greenberg
>> http://www.jeffrey-greenberg.com <http://www.jeffrey-greenberg.com/>
>> -- 
>> Ec2 mailing list
>> Ec2 at lists.ubuntu.com <mailto:Ec2 at lists.ubuntu.com>
>> Modify settings or unsubscribe at:
>> https://lists.ubuntu.com/mailman/listinfo/ec2
> I found this to be a good starting point:
> http://blog.nrgup.net/2009/04/amazon-ec2-mysql-script-for-gfs-snapshots/
> It uses the SimpleDB service to keep track of snapshot expiration, and
> there are sample crontab entries to keep 1 day of hourly, 7 days of
> daily, 4 weeks of weekly and 1 year of monthly snapshots.
> --
> Roger Marshall

More information about the Ec2 mailing list