Sync two buckets through boto3

Question:

Is there any way to use boto3 to loop the bucket contents in two different buckets (source and target) and if it finds any key in source that does not match with target, it uploads it to the target bucket. please note I do not want to use aws s3 sync. I am currently using the following code for doing this job:

Answer:

If you only wish to compare by Key (ignoring differences within objects), you could use something like:

Leave a Reply