aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

Add no-overwrite option to `s3 cp` and `s3 mv` commands

Open vz10 opened this issue 3 years ago • 7 comments

Issue #, if available: #2874

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

vz10 avatar Apr 14 '21 21:04 vz10

Codecov Report

Merging #6095 (f82c4a3) into v2 (4172ada) will increase coverage by 0.00%. The diff coverage is 97.36%.

:exclamation: Current head f82c4a3 differs from pull request most recent head 2bda3e5. Consider uploading reports for the commit 2bda3e5 to get more accurate results Impacted file tree graph

@@           Coverage Diff           @@
##               v2    #6095   +/-   ##
=======================================
  Coverage   94.14%   94.15%           
=======================================
  Files         271      271           
  Lines       21550    21608   +58     
=======================================
+ Hits        20288    20344   +56     
- Misses       1262     1264    +2     
Impacted Files Coverage Δ
awscli/customizations/s3/filters.py 98.43% <97.22%> (-1.57%) :arrow_down:
awscli/customizations/s3/subcommands.py 97.24% <100.00%> (+0.01%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4172ada...2bda3e5. Read the comment docs.

codecov-io avatar Apr 14 '21 23:04 codecov-io

This seems like it would be prone to race condition issues since it's just a HEAD then a write.

four43 avatar Sep 13 '21 19:09 four43

@vz10 - hi! Any update on this PR?

jfstephe avatar Nov 11 '21 13:11 jfstephe

Any update to this PR? I in need for no-overwrite option.. thanks!

jjchoi08 avatar Jun 08 '22 03:06 jjchoi08

you can't implement a no-overwrite option in S3. it's not possible to do without race conditions.

orf avatar Aug 10 '22 13:08 orf

This doesn't fix the problem but may help some people out there in specific scenarios! https://github.com/jfstephe/aws-s3-lock

jfstephe avatar Aug 10 '22 13:08 jfstephe

you can't implement a no-overwrite option in S3. it's not possible to do without race conditions.

"get item, do not upload if it exists" is what is requested here, and that is trivial to implement, nobody said it needs to be atomic

grosser avatar Aug 10 '22 15:08 grosser

Hey everyone, thanks for this pull request and the discussion around it. We've made the decision to close this pull request, and leave the feature request open for tracking purposes. There is certainly value in the feature being requested here, but this isn't something we can really accept a pull request for, as there are implementation details that need to be handled internally. Please continue to 👍 the tracking issue (https://github.com/aws/aws-cli/issues/2874), and describe your use cases for such a feature in the replies.

RyanFitzSimmonsAK avatar Mar 20 '24 21:03 RyanFitzSimmonsAK