生命周期是否取决于删除或创建对象的时间

生命周期是否取决于删除或创建对象的时间

本文介绍了生命周期是否取决于删除或创建对象的时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Google云端存储中设置了此生命周期

I have this lifecyle set on my Google Cloud Storage

  "action": {"type": "Delete"},
  "condition": {"age": 7, "isLive": false}

如果我删除文件,生命周期删除事件将在7天后发生,或者如果文件已存在7天以上,它将立即生效吗?

If I remove a file will the lifecycle delete event occur 7 days later or will it apply immediately if the file is already over 7 days old?

当我使用gsutil ls -a时,删除文件后版本似乎没有变化,这使我认为该文件将在生命周期内被视为已经存在7天以上.

When I use gsutil ls -a it seems like the version doesn't change when I remove a file which makes me think that it will get treated by lifecycle as if it is already over 7 days old.

在这种情况下,如何在删除文件7天后删除我的文件?

If that is the case how can I have my files deleted 7 days after they are removed?

推荐答案

如果删除文件,该文件将被立即删除. 7天后什么都不会发生.

If you remove a file, it will be deleted immediately. Nothing will happen 7 days later.

如果您在具有该生命周期策略的存储桶中已有一个对象,则该对象在达到7天后会在某个时候被GCS删除.无法保证会立即将其删除,但通常会在不到一天的时间内发生.

If you have an existing object in a bucket with that lifecycle policy, it will be deleted by GCS at some point after it reaches 7 days old. There is no guarantee that it will be deleted immediately, but it will usually happen in less than a day.

这篇关于生命周期是否取决于删除或创建对象的时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 07:47