Reputation: 6753
I have an S3 bucket carrying X amount of files. I want to include a rule where if the date modified of a file exceeds X amount of days, I want the file moved to another folder called archive within the same directory the rule is applied to.
Can this be set in the S3 web UI somehow? I know a form of deletion rule can be set there (expiration). If not the UI, can it be done through the AWS command line?
Upvotes: 0
Views: 1228
Reputation: 6079
Unfortunately you can't add conditional policies that apply to objects in S3 object lifecycle configuration which in your case is, is based on the object's last access or modified time.
Also you already know you can transition objects to Glacier based on their age or on a specific date.
You can refer this AWS Documentation
However You can reset the creation date time with a command like:
aws s3api copy-object --storage-class STANDARD --copy-source $bucket/$file --bucket $bucket --key $file
You can refer this blog post for details.
Hope this helps.
Upvotes: 1