3
votes

When using the aws s3 cli to sync the files of a web app over to my s3 bucket I noticed that the sync command always uploads every file, even though they didn't actually change. Whats changed though is the timestamp of the files. So I was wondering how the sync command figures out which files it needs to upload?

Does sync only compare file name and timestamp?

1
Most software tools will assume that the file has changed if the timestamp (last modified date) changes. The AWS CLI is open source. Study the source code for the sync command. This will also help you understand AWS better. - John Hanley

1 Answers

4
votes

Timestamp and Size.

If you want sync to consider size only:

--size-only (boolean) Makes the size of each key the only criteria used to decide whether to sync from source to destination.