dimanche 30 août 2015

Amazon S3 sync Deleting excluded files

I have 2 buckets, Bucket A and Bucket B. Bucket A contains Javascript files and bucket B contains a mix of javascript and other file types. I am trying to do a sync of only JS files from bucket A to B.

I am using the following:

aws s3 sync s3://bucket-a s3://bucket-b --delete --exclude "*" --include "*.js"

I was assuming that this will leave bucket B with an exact copy of all of the js files. However the above command will start deleting all of the non js files in Bucket B.

When I run the following command:

aws s3 sync . s3://bucket-b --delete --exclude "*" --include "*.js"

With the current directory containing a copy of bucket A, bucket B will have the same js files as bucket A and non js files will not be affected.

Why is this command functioning differently when syncing local to bucket compared to bucket to bucket?




Aucun commentaire:

Enregistrer un commentaire