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

aws s3 sync --exact-timestamps {from-s3} {to-local} does not check the time correctly. #8092

Closed
h-r-k-matsumoto opened this issue Aug 10, 2023 · 3 comments
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@h-r-k-matsumoto
Copy link

Describe the bug

When running aws s3 sync --exact-timestamps {from-s3} {to-local}, always copying files even if no changes.

Expected Behavior

Once copied a file by sync command, copy does not happen in next time.

Current Behavior

Always copy is happened.
It is caused by the difference in date precision.
I've confirmed that the following command and result.

aws s3 sync --delete --no-guess-mime-type --exact-timestamps s3://src-dir ./dst --dryrun --debug
....
2023-08-10 06:21:26,988 - MainThread - awscli.customizations.s3.syncstrategy.base - DEBUG - syncing: xxx -> xxx, size: 669 -> 669, modified time: 2023-07-26 04:20:07.326000+00:00 -> 2023-07-26 04:20:07+00:00

Here is the point.

modified time: 2023-07-26 04:20:07.326000+00:00 -> 2023-07-26 04:20:07+00:00

When syncing file by aws s3 sync , part of milli seconds is missing, and the date difference happen every time by the below.
https://github.com/aws/aws-cli/blob/develop/awscli/customizations/s3/syncstrategy/exacttimestamps.py#L40

Reproduction Steps

aws s3 sync --delete --no-guess-mime-type --exact-timestamps s3://src-dir ./dst --dryrun --debug
  1. Please specify source directory that has files with timestamp has a millisecornds.

Possible Solution

I'm not familiar with Python,but we think 2 options.

a) allow less than 1 sec.
https://github.com/aws/aws-cli/blob/develop/awscli/customizations/s3/syncstrategy/exacttimestamps.py#L40

b) update timestamp with keeeping precise.
https://github.com/aws/aws-cli/blob/develop/awscli/customizations/s3/utils.py#L382

Additional Information/Context

No response

CLI version used

aws-cli/2.13.3 Python/3.11.4 Darwin/22.5.0 exe/x86_64 prompt/off

Environment details (OS name and version, etc.)

Mac OS 13.4.1

@h-r-k-matsumoto h-r-k-matsumoto added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 10, 2023
@h-r-k-matsumoto
Copy link
Author

I saw the following issues, but seems not same is what cause is.
So I created this issue.

@h-r-k-matsumoto
Copy link
Author

Ah.. sorry, this is a same with #5730 (comment).
let me close this ticket.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant