I've seen lots of examples of doing a one way sync to an S3 bucket from a windows file system, but I'd like to do this the other way.
I've had a system that used regular aws sync but somewhat to my horror local changes where being reflected back up to the bucket. I cant figure a way to get this to only sync in one direction.
aws cp does work, but it seems to get a whole new copy every time, and the bucket has half a TB of data, which is, not ideal at all from a costs and bandwidth perspective, particularly when theres only a few hundred MB of changes each day.
Would someone be able to point me in the right direction to solving this, or if I've managed to miss a question asking about this, perhaps point me to that (I've looked, but it maybe my google-fu is a little rusty lately)
Use the CLIv2 "aws s3 sync" command.
The description from that page is "Recursively copies new and updated files from the source directory to the destination. Only creates folders in the destination if they contain one or more files.". This fulfills your requirement to copy from S3 to local, not sync in both directions.
Here's an example command I use to copy my local backups to s3, including removing files from S3 that no longer existing on the local disk