AWS s3 sync re-copies files that haven't changed since last run

Viewed 383

I want to periodically copy all new and changed objects from one S3 bucket to another. These objects are encrypted at rest using AWS:KMS so I'm using the following AWS CLI command:

aws s3 sync --size-only s3://com.bucket1.name s3://com.bucket2.name --sse=aws:kms --sse-kms-key-id <my key id>

When I run this multiple times, I want subsequent runs to only do an "incremental sync" and only copy files from bucket1 to bucket2 IF they have been added or changed in bucket1 since the last sync. And this is exactly what happens if I run this, say, twice within a few hours of each other. However, if I run it today then run it again tomorrow, then ALL files are re-copied.

Why are unchanged files being re-copied if I wait too long between consecutive runs of this command?

0 Answers
Related