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

Introduce a flag to preserve timestamps of files #534

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ahuge
Copy link

@Ahuge Ahuge commented Nov 7, 2022

This PR is in response to issue #532

We are implementing a flag that when activated will record and store ctime, mtime, and atime in S3 as metadata on the object.
When pulling files down, if that data exists, we will set it on the files as well.

Linux & Darwin don't appear to allow setting of ctime, however atime and mtime are preserved.
Windows does allow us to set ctime, mtime, and atime, however they are actually referred to as CreationTime, LastAccessTime, and LastWriteTime.

Please let me know if you have feedback on this PR.
Thanks!

The `--preserve-timestamp` flag will set metadata on the s3 objects and
then update the files on disk during a download.

If the `--preserve-timestamp` flag is passed during an upload the following metadata keys will be set:
  - x-amz-meta-file-ctime
  - x-amz-meta-file-mtime
  - x-amz-meta-file-atime

If the `--preserve-timesamp` flag is passed during a download, s5cmd
will attempt to modify the created files on disk.
  **There doesn't appear to be a way to change the created date on Linux
@Ahuge Ahuge requested a review from a team as a code owner November 7, 2022 16:25
@Ahuge Ahuge requested review from igungor and seruman and removed request for a team November 7, 2022 16:25
@strophy
Copy link

strophy commented Sep 9, 2023

I'd love to see this merged - @Ahuge could you rebase it and maybe ping a maintainer to try again for a review?

@seruman
Copy link
Member

seruman commented Sep 9, 2023

Hi @Ahuge, thanks for the PR.

With the addition of #621 and the request #350, I think these two could be handled in a similar fashion as s5cmd specific file metadata. I have a PoC which is not ready for a review yet. I would like to get your thoughts on it once it is ready.

I kindly request for you to wait for it to get your thoughts if it would cover yours and @strophy's use cases.

@strophy
Copy link

strophy commented Nov 6, 2023

Hi @seruman just checking on progress and if there is anything I can do to help move this issue along? Having this feature would allow us to switch back to s5cmd from aws-cli, with big performance benefit.

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 this pull request may close these issues.

None yet

3 participants