What is the difference between sync and cp operations in S3? - Big Data In Real World

What is the difference between sync and cp operations in S3?

How to fix Kafka Broker may not be available on 127.0.0.1 error?
May 8, 2023
How to query data from Snowflake in Spark?
May 15, 2023
How to fix Kafka Broker may not be available on 127.0.0.1 error?
May 8, 2023
How to query data from Snowflake in Spark?
May 15, 2023

This post describes the differences in sync and cp operations in S3 and which one should be preferred.

sync

aws s3 sync copies any files that have changed on the source location. It does not delete anything on the target location. Both source and destination may not look the same after this operation.

aws s3 sync –delete copies files changed in the source location. It deletes files from the target location that is not present. Both source and destination will look the same after this operation.

cp

aws s3 cp copies all files from source to target, regardless of where they are changed in source or not and it does not delete anything on the target.

sync should be preferred over cp because sync only works on the affected or changed objects rather than affecting all objects thereby has a cost advantage.

Big Data In Real World
Big Data In Real World
We are a group of Big Data engineers who are passionate about Big Data and related Big Data technologies. We have designed, developed, deployed and maintained Big Data applications ranging from batch to real time streaming big data platforms. We have seen a wide range of real world big data problems, implemented some innovative and complex (or simple, depending on how you look at it) solutions.

Comments are closed.

What is the difference between sync and cp operations in S3?
This website uses cookies to improve your experience. By using this website you agree to our Data Protection Policy.

Hadoop In Real World is now Big Data In Real World!

X