如何指定对象过期preFIX不目录匹配? [英] How to specify an object expiration prefix that doesn't match the directory?

查看:228
本文介绍了如何指定对象过期preFIX不目录匹配?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个S3桶 IMG MOV TMP 目录。我想一切都加入到 TMP 一旦它已经结束了三天的将自动删除。所以我成立了规则对象届满我斗,像这样:

I have an S3 bucket with img, mov, and tmp directories. I would like everything added to tmp to be removed automatically once it's over three days old. So I set up object expiration rules on my bucket like so:

  • preFIX:TMP /
  • 有效期:3

现在的问题是,虽然里面的 TMP 文件如期被删除, TMP 本身也能够匹配这个preFIX(dispite后面的斜线)和被删除每三天。

The problem is, while the files inside tmp are removed on schedule, tmp itself also matches this prefix (dispite the trailing slash) and gets deleted every three days.

有没有preFIX,将匹配 TMP 的内容,而不是 TMP 本身?像TMP / *(尽管这不工作)?

Is there any prefix that will match the contents of tmp, but not tmp itself? Something like "tmp/*" (though that doesn't work)?

推荐答案

你为什么要保留 TMP 呢?

亚马逊S3 实际上并没有对文件夹/目录中的原生的概念,而是一个平包括水桶,只有对象/密钥存储架构 - 该目录式的presentation为S3看到在大多数的工具(包括的 AWS管理控制台的本身)是完全基于惯例,即模拟层次与你的情况一样prefixes(如 TMP / )的对象;请参见相应的常见问题解答如何Amazon S3的数据组织

Amazon S3 doesn't actually have a native concept of folders/directories, rather is a flat storage architecture comprised of buckets and objects/keys only - the directory style presentation seen in most tools for S3 (including the AWS Management Console itself) is based solely on convention, i.e. simulating a hierarchy for objects with identical prefixes (e.g.tmp/ in your case); see the respective FAQ How is Amazon S3 data organized?:

亚马逊S3是一个简单的基于密钥的对象存储。当您存储数据,你   分配以后可以用于检索一个唯一的对象键   数据。键可以是任何字符串,和可以构造模仿   分层属性。

Amazon S3 is a simple key-based object store. When you store data, you assign a unique object key that can later be used to retrieve the data. Keys can be any string, and can be constructed to mimic hierarchical attributes.

[重点煤矿]

这建筑是 Amazon S3的概念的:

一个桶是一个容器存储在Amazon S3的对象。每个对象   包含在水桶。例如,如果该对象的命名   照片/小狗.jpg 被存储在johnsmith桶,则它是   寻址使用URL    http://johnsmith.s3.amazonaws.com/photos/puppy.jpg

A bucket is a container for objects stored in Amazon S3. Every object is contained in a bucket. For example, if the object named photos/puppy.jpg is stored in the johnsmith bucket, then it is addressable using the URL http://johnsmith.s3.amazonaws.com/photos/puppy.jpg

[...]

的关键是水桶中的对象的唯一标识。每   水桶对象有且只有一个键。因为一个结合   斗,密钥和版本ID唯一标识每个对象,亚马逊S3   可以被认为是一个基本的数据图斗+按键+版之间   和对象本身。

A key is the unique identifier for an object within a bucket. Every object in a bucket has exactly one key. Because the combination of a bucket, key, and version ID uniquely identify each object, Amazon S3 can be thought of as a basic data map between "bucket + key + version" and the object itself.

[重点煤矿]

因此​​,不应该有任何需要关心这些'目录'可言,他们只是复出你碰巧存储的对象与各自的preFIX在其名称中的任何时间。

Therefore there shouldn't be any need to care about these 'directories' at all, they will just resurface any time you happen to store an object with a respective prefix in its name.

这篇关于如何指定对象过期preFIX不目录匹配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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