Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to "touch" files? (update last-modified date to reset Lifecycle policy timer) #666

Open
GordonGustafson opened this issue Sep 21, 2023 · 1 comment · May be fixed by #668
Open

Comments

@GordonGustafson
Copy link

I've tried things like this to see if the LastModified time updates:

s5cmd cp --expires "2024-10-01T20:30:00Z"  's3://bucket/path/*' s3://bucket/path/

But I get this error:

 InvalidRequest: This copy request is illegal because it is trying to copy an object to itself without changing the object's metadata, storage class, website redirect location or encryption attributes. status code: 400

I can get the behavior I want with the AWS CLI like so:

aws s3 cp s3://bucket/path s3://bucket/path --recursive --metadata-directive REPLACE

I know I could just copy the data to another path and copy it back to reset the LastModified timestamp, but wondering if there's a better way with s5cmd. Thanks!

@GordonGustafson GordonGustafson changed the title Any way to "touch" files? (update last-modified date to prevent Lifecycle police from deleting) Any way to "touch" files? (update last-modified date to reset Lifecycle policy timer) Sep 21, 2023
@denizsurmeli
Copy link
Contributor

Hi, thanks for mentioning this issue. I believe that what we need to do is add a new flag called metadataDirective to the cp command. Will work on a PR as soon as I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants