简体   繁体   English

如果文件内容未更改,如何避免在S3中更新文件

[英]How to avoid updating files in S3 if the file content hasn't been changed

I am trying to upload a bunch of files in an existing local directory to an S3 bucket on a daily basis I would like to re-upload only if newer files have been added or existing files have been modified in my local directory. 我每天尝试将现有本地目录中的一堆文件上传到S3存储桶,仅在添加了新文件或在本地目录中修改了现有文件的情况下,我才想重新上传。

For example, I have a local image directory that contains the following image files, image1, image2, image3 例如,我有一个本地图像目录,其中包含以下图像文件:image1,image2,image3

Day 1: Uploaded all the 3 images to s3 第一天:将所有3张图片上传到s3

Day 2: Added a new file called image4 in the local directory. 第2天:在本地目录中添加了一个名为image4的新文件。 I want to upload only image4 since the other files are existing in S3 我只想上传image4,因为S3中存在其他文件

Day 3: Modified image2 and added a new file image5 in the local directory. 第3天:修改了image2并在本地目录中添加了新文件image5。 I want to upload both image2 and image5 to S3 我想将image2和image5都上传到S3

Is there a way to optimize. 有没有一种优化的方法。 what needs to be uploaded instead of blindly uploading all files in the local directory. 需要上传的内容,而不是盲目上传本地目录中的所有文件。

What kind of metadata is available for an uploaded file in S3 which will allow me to make an intelligent decision here. S3中上传的文件可以使用哪种元数据,这将使我在这里做出明智的决定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM