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
You can easily script something to do this for you.
EC2_CERTandEC2_PRIVATE_KEYin order to be able to use the API toolsec2-describe-snapshotsThe 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.