I have been an Amazon Web Services customer for several years now and one of the things I use the account for is backing up my home computers to the cloud using Amazon's Simple Storage Service (S3). Over time I racked up over a terabyte of files for one of my computers in back up data alone. This got expensive, over $70 a month, and I decided it wasn't necessary and would prefer to back up only the assets that were valuable to me, like my photography catalog. Unfortunately, Amazon doesn't make it easy to delete your data in the cloud. It was impossible to delete the tens of thousands of files one by one and I struggled for months trying to figure out a way to delete them all at once that was within my capabilities. I am not a software programmer and some of the options recommended to me, like S3Nuke or S3cmd, were beyond my skill set to implement.
Fortunately, I stumbled across a comment by chris14679 in a post on the subject at stackoverflow.com that details how to do it using Amazon's Lifecycle rules feature in the Amazon S3 console. Below I outline his instructions:
- Right click on the bucket name in AWS S3 console, select "Properties"
- In the row of tabs at the bottom of the page under properties select "lifecycle" and "add rule"
- Create a lifecycle rule with the "Prefix" field set blank (blank means all files in the bucket, or you could set it to "a" to delete all files whose names begin with "a").
- Set the "Days" field to "1"
As long as all the files are more than one day old they will all get deleted within 24 hours (you don't have to stay on the site), then you can delete the bucket.
This works great and saved me a lot of time and a decent bit of change. Thanks chris14679!







