amazon-web-servicesamazon-s3gulp

AWS S3 sync command based on file size only?


Is it possible to run the S3 sync command but only upload the files based on file size and not just include the modified date time of the file?

I am currently running:

aws s3 sync ./../app/dist s3://mywebsite.me/dist --acl public-read

The issue I have is I run gulp commands prior to this and files are generated even though the contents of the files are not changed.

Then doing the sync causes files to be uploaded that have not been modified in terms of content.


Solution

  • You can use the --size-only sync switch for that.

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