Skip to content

Commit c3fa0d1

Browse files
domoberzinManagorgutjuri
authored
aws-s3-sync: add page (#15972)
Co-authored-by: Managor <[email protected]> Co-authored-by: Juri Dispan <[email protected]>
1 parent 003ff17 commit c3fa0d1

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

pages/common/aws-s3-sync.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# aws s3 sync
2+
3+
> Recursively sync files and directories between your local system and an S3 bucket, or between S3 buckets.
4+
> More information: <https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3/sync.html>.
5+
6+
- Sync files and directories from local to a bucket:
7+
8+
`aws s3 sync {{path/to/file_or_directory}} s3://{{bucket_target_name}}/{{path/to/remote_location}}`
9+
10+
- Sync files and directories from a bucket to local:
11+
12+
`aws s3 sync s3://{{bucket_source_name}}/{{path/to/remote_location}} {{path/to/file_or_directory}}`
13+
14+
- Sync objects between two buckets:
15+
16+
`aws s3 sync s3://{{bucket_source_name}}/{{path/to/remote_location}} s3://{{bucket_target_name}}/{{path/to/remote_location}}`
17+
18+
- Sync local files to S3 while excluding specific files or directories:
19+
20+
`aws s3 sync {{path/to/file_or_directory}} s3://{{bucket_target_name}}/{{path/to/remote_location}} --exclude {{path/to/file}} --exclude {{path/to/directory}}/*`
21+
22+
- Sync objects between buckets and delete destination files not in source:
23+
24+
`aws s3 sync s3://{{bucket_source_name}}/{{path/to/remote_location}} s3://{{bucket_target_name}}/{{path/to/remote_location}} --delete`
25+
26+
- Sync to S3 with advanced options (set ACL and storage class):
27+
28+
`aws s3 sync {{path/to/local_directory}} s3://{{bucket_name}}/{{path/to/remote_location}} --acl {{private|public-read}} --storage-class {{STANDARD_IA|GLACIER}}`
29+
30+
- Sync files to S3 and skip unchanged ones (compare size and modification time):
31+
32+
`aws s3 sync {{path/to/file_or_directory}} s3://{{bucket_name}}/{{path/to/remote_location}} --size-only`
33+
34+
- Display help:
35+
36+
`aws s3 sync help`

0 commit comments

Comments
 (0)