How to use the -onlydiff switch with local encryption (-le)
When using local encryption (-le), the MD5 value of the files that are uploaded to S3 will no longer match the local MD5 value, because the files are encrypted before being uploaded. This will prevent the -onlydiff switch from working properly. However there are alternatives:
One alternative is to use the -onlynewer switch instead of the -onlydiff switch.
The -onlynewer switch instructs S3Express to only upload files that have a newer timestamp locally compared to files that are already on S3 but are older. Checking timestamp of S3 objects is very fast because the S3 metadata of each S3 object do not need to be checked.
The other possibility is to use the original MD5 value that is stored in the S3 metadata of locally encrypted files. When uploading locally encrypted files to S3, S3Express stores the original MD5 value in the metadata header x-amz-meta-s3xpress-encrypted-orig-md5. So, by adding the following condition to the upload command, you can upload only files that have a changed MD5: -cond:"md5<>x-amz-meta-s3xpress-encrypted-orig-md5".
For instance: put c:\localfolder\ bucketname -s -le -cond:"md5<>x-amz-meta-s3xpress-encrypted-orig-md5"
Note that the metadata of each S3 object must be check in this case which can take a long time if there are many files to check (it depends also on the available connection speed to Amazon S3).