Skip to content

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

@GordonGustafson

Description

@GordonGustafson

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions