Is there an easy way to set up a bucket in s3 to automatically delete files older than x days?

link|improve this question
feedback

3 Answers

up vote 2 down vote accepted

No, S3 is just a datastore. You'll need to use some outside client to periodically delete the old files.

link|improve this answer
feedback

Amazon has meanwhile introduced S3 lifecycles (see the introductory blog post Amazon S3 - Object Expiration), where you can specify a maximum age in days for objects in a bucket - see Object Expiration for details on its usage via the S3 API or the AWS Management Console.

link|improve this answer
+1 for providing an update regarding this outdated information, thanks! – Steffen Opel Feb 26 at 16:44
feedback

You can use s3cmd to write a script to run through your bucket and delete files based on a precondition.

You'll need to write some code (bash, python) on top of it.

You can download s3cmd from http://s3tools.org/s3cmd

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.