aws-s3-sync
Synchronize directories and S3 prefixes
TLDR
Sync a local directory to an S3 bucket
SYNOPSIS
aws s3 sync source destination [options]
DESCRIPTION
aws s3 sync synchronizes directories and S3 prefixes by recursively copying new and updated files from the source to the destination. It only transfers files that are new or have changed, making it efficient for incremental backups and deployments.
By default, sync compares file size and last modified time to determine which files need updating. It creates folders in the destination only if they contain files.
PARAMETERS
--delete
Delete destination files that don't exist in the source--dryrun
Display operations that would be performed without executing them--quiet
Suppress all output except errors--no-overwrite
Only transfer files not present at the destination--size-only
Use file size alone to determine if sync is needed (ignore timestamps)--exact-timestamps
Match timestamps exactly when syncing from S3 to local--include pattern
Include files matching the pattern--exclude pattern
Exclude files matching the pattern from the sync--acl value
Set access control list: private, public-read, etc.--storage-class value
Specify storage class: STANDARD, STANDARD_IA, GLACIER, etc.--source-region value
Source bucket region (required for cross-region S3 to S3 sync)
CAVEATS
The --delete option removes files from the destination that don't exist in the source; use with caution. Pattern matching with --include and --exclude is order-dependent. When syncing to local, directories are not created unless they contain files. Sync does not preserve symbolic links.
