Do not load in aws s3 if the exact file already exists in the bucket

I want to periodically move images from a local directory to s3, but I do not want to overwrite files that were previously migrated that have not changed since. Here are the options I reviewed:

  • Compare the length of the content. Disadvantage: the new version of the file may have the same content length, but be different.

  • Save local modification information in s3 metadata for comparison in push mode. Disadvantage: this requires POST and PUT, doubling the downloaded data, adding service data to the push task and can be inconsistent when starting from different computers.

There must be a better way. What am I missing?

PS I use aws-s3 pearl in a rake problem.

+4
source share
1 answer

A good tool is s3cmd with the --sync option. http://s3tools.org/s3cmd

-2
source

Source: https://habr.com/ru/post/1413225/


All Articles