1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
Hi,
You'll see examples of lifecycle rules on this page: https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html like this one
<LifecycleConfiguration>
<Rule>
<ID>Transition and Expiration Rule</ID>
<Filter>
<Prefix>tax/</Prefix>
</Filter>
<Status>Enabled</Status>
<Transition>
<Days>365</Days>
<StorageClass>S3 Glacier Flexible Retrieval</StorageClass>
</Transition>
<Expiration>
<Days>3650</Days>
</Expiration>
</Rule>
</LifecycleConfiguration>
The rules are heavily based on prefix. So, I would suggest a slight change in your directory structure:
/keep100/[data to keep for 100 days structure]
/keep365/[data to keep for 100 days structure]
Then you can easily apply the <Expiration> xml node that you need in a lifecycle applied to the distinct prefixes.
Best
Didier
관련 콘텐츠
- AWS 공식업데이트됨 일 년 전
- AWS 공식업데이트됨 2년 전
Thank you. I was looking for a way to dynamically tag files located in prefixes using text contained in the prefix name. There will be hundreds of prefixes with files that need to be tagged. Yes I could rearrange the directory structure to make things a bit more simple but wanted to exhaust what can be done with the current file structure.