Ad space (banner)
AD

Got the fundamentals? A structured AWS course is a fast way to level up.

Find AWS courses on Udemy

Affiliate link. Costs you nothing extra.

☁️AWS Lessons
Lesson 20 / 41

Syncing a Folder with aws s3 sync

When you want a whole directory in S3 and don't want to re-upload what hasn't changed, use aws s3 sync. It transfers only the differences.

The syntax is aws s3 sync source destination.

Running aws s3 sync ./dist s3://my-bucket uploads the files that are new or modified and leaves the rest alone.

A common stumble is expecting sync to delete remote files that no longer exist locally. It doesn't unless you add --delete — and that flag deserves care.

In real work, it is the standard way to publish a built static site to S3.

AWS
Try it (type this into the pseudo terminal)
aws s3 sync ./dist s3://my-bucket

🧑‍💻 You can type this command into the AWS pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)