Back in October I wrote about automating
This week Amazon rolled out Object Expiration for S3 allowing you to automatically expire files in a bucket based on name and time criteria. Amazon has an excellent guide to configuring Object Expiration via the AWS Console.
To test this I set one of my buckets up for 5 day expiration of any files named ‘backup’ (my existing scripts all maintain 7 days of backups)
When I checked this morning there were 5 backups remaining
You can verify which rule applies to an object by selecting the object and examining the properties. One word of caution, Object Expiration rules are for a bucket, so even if you have Folders with in a bucket the rule is global, make sure you understand what objects you are expiring.
Why expire objects in S3? In S3 (and all of the AWS services) you pay for what you use, by managing the number of files (in this case backups) stored at any given time my costs are kept to a minimum. For December so far my S3 charges are 0.17 (yes that is 17 cents to store my backups for 3 websites and a number of MySQL databases).
Links
Amazon S3 announces Object Expiration