如何删除或清除 S3 上的旧文件? [英] How to delete or purge old files on S3?

查看:23
本文介绍了如何删除或清除 S3 上的旧文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在删除任何超过 x 天的文件的现有解决方案?

Are there existing solutions to delete any files older than x days?

推荐答案

亚马逊推出了 对象过期 最近.

Amazon has introduced object expiration recently.

Amazon S3 宣布对象过期

Amazon S3 Announces Object Expiration

Amazon S3 宣布了一个新的功能,对象过期,允许您安排删除您的对象在预定义的时间段后.使用对象过期安排定期清除对象消除了对您的需要识别要删除的对象并向亚马逊提交删除请求S3.

Amazon S3 announced a new feature, Object Expiration that allows you to schedule the deletion of your objects after a pre-defined time period. Using Object Expiration to schedule periodic removal of objects eliminates the need for you to identify objects for deletion and submit delete requests to Amazon S3.

您可以为一组对象定义对象过期规则你的桶.每个对象过期规则允许您指定一个前缀和以天为单位的到期期限.前缀字段(例如logs/) 标识受到期规则约束的对象,并且有效期指定从创建日期算起的天数(即年龄)之后应该删除对象.一旦对象已超过其到期日期,它们将排队等待删除.你将不收取存储在其上或之后的对象的费用到期日期.

You can define Object Expiration rules for a set of objects in your bucket. Each Object Expiration rule allows you to specify a prefix and an expiration period in days. The prefix field (e.g. logs/) identifies the object(s) subject to the expiration rule, and the expiration period specifies the number of days from creation date (i.e. age) after which object(s) should be removed. Once the objects are past their expiration date, they will be queued for deletion. You will not be billed for storage for objects on or after their expiration date.

这篇关于如何删除或清除 S3 上的旧文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆