I'd expect this to be fairly routine, but cannot find a simple approach for creating an managing EBS snapshots automatically.
Was hoping there'd be a shceduler in the AWS console.. alas not yet.
Would appreciate any suggestions as to how best to do this on from Ubuntu.
Thanks
A wonderful script to create an automatic snapshots.
https://github.com/rakesh-sankar/Tools/blob/master/AmazonAWS/EBS/EBS-Snapshot.sh
Just copy the code and create a file, then add a cronjob whenever you want it to run.
Take a look at AWS missing tools and especially to https://github.com/colinbjohnson/aws-missing-tools/tree/master/ec2-automate-backup This does what you need.
You can easily script something to do this for you.
EC2_CERT
andEC2_PRIVATE_KEY
in order to be able to use the API toolsec2-describe-snapshots
The results look something like:
You can then do some parsing of the dates and sorting and start removing the older snapshots.
NOTE: I don't know if we can trust the sort order but I've never seen it sort any other way than oldest to newest.
To delete a snapshot, use
ec2-delete-snapshot snap-xxxxxxxx
.The rest I leave to you as a simple Bash script that you can call daily or however often you need from cron.
Shameless plug, but - you can give Ebs2s3 a go: https://github.com/ajmfulcher/ebs2s3
Rails app to automate snapshot creation and prune old snapshots. Introduction and some screenshots here: http://ajmfulcher.blogspot.com/2011/04/ebs2s3-automated-backup-for-amazon-ebs.html
I found this, hope it helps:
See: Bulk Delete EBS Snapshots From the Command Line (A Howto).