liveBook · Manning

Sync command

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

The AWS CLI sync command synchronizes files between a local directory and an S3 location by transferring new or changed files.

The AWS CLI sync command compares a local directory with an S3 location and transfers only new or changed files. It is useful for backing up local data to a bucket. section 7.3

$ aws s3 sync $path s3://awsinaction-$yourname/backup

Use this command pattern to synchronize a local folder with a backup prefix in S3, replacing the placeholders with your values. section 7.3

Back up a folder

Choose a local folder, preferably smaller than 1 GB to limit waiting time and Free Tier usage. Run sync to upload it to the bucket's /backup location; transfer time depends on folder size and internet speed. section 7.3

A basic backup workflow includes:

  • Create or select an S3 bucket. section 7.3
  • Synchronize the local folder with the bucket's backup prefix. section 7.3
  • Restore files separately by recursively copying the S3 backup to another local folder. section 7.3

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Explains comparison and selective transfer, then demonstrates backup and restore without detailing synchronization internals.
Examples
Uses a Desktop folder, an S3 backup prefix, and a separate Downloads restore folder.
What it assumes
Assumes a local folder, an S3 bucket, a terminal, and AWS CLI access.
What you can do after
Apply it via AWS CLI to upload changed files and restore backed-up data.
How it connects
Connects local directories, S3 buckets, S3 object versioning, backup, and restore.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.