2 Answers
- Newest
- Most votes
- Most comments
2
From the CLI consider using --recursive --exclude "*/*" this should prevent copying of any objects with a / in the key which you can use to indicate a sub-folder. Be aware that this will process every object in the source location as it will need to determine if the key contains the exclude pattern.
Further info at Use of Exclude and Include Filters
answered 3 years ago
0
@Rob - after seeing it not work, I tried a few --exclude combinations and got it, then re-visited the post/my command and neglected the *, so re-tested and worked perfect!
Thanks much, this was an easy / yet annoying one!
answered 3 years ago
Relevant content
- asked 5 years ago
- asked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Thanks @RoB - unfortunately, didn't work. I didn't get an error, however it did move the root folders;
command: aws s3 mv s3://bucket/documents/00000154/ s3://bucket/documents/00000154/archive/ —recursive —exclude “/”
result: move: s3://bucket/documents/00000154/Index/_2j.fdx to s3://bucket/documents/00000154/archive/Index/_2j.fdx
Naturally there were hundreds of the root that did move, but I had 2 folders in the root that got moved into the archive folder.