sync

Prev Next

Available in Classic and VPC

Sync buckets created in Ncloud Storage, as well as local directories, folders, and objects.

Commands

The command statement is as follows:

aws s3 sync <source> <destination> --endpoint-url <value> [--options] 

Parameter

The following describes the parameters.

Parameter Type Required Description Restrictions
--endpoint-url <value> string Y Specify the default URL for command calls. It is only available for the KR Region. See Ncloud Storage overview for call domain information.
--dryrun boolean N Only check the results of the action, but do not actually apply them. -
--quiet boolean N Response results not displayed -
--include <value> string N Set the rule to include only specified objects in commands and apply them in the specified order. -
--exclude <value> string N Set the rule to exclude specified objects from commands and apply them in the specified order. -
--follow-symlinks or --no-follow-symlinks boolean N Set whether to upload the content of symbolic links in uploaded file. Only applicable when uploading objects from the local file system
--no-guess-mime-type boolean N Disable automatic content type determination for uploaded object. -
--storage-class <value> string N Specify the storage class for storing the object. Available options
- STANDARD
- DEEP_ARCHIVE
* It stores it as Standard class by default.
--content-type <value> string N Define explicit content type. -
--cache-control <value> string N Set caching behavior. -
--content-disposition <value> string N Specify representation information for the object. -
--content-encoding <value> string N Set content encoding. -
--content-language <value> string N Set content language. -
--only-show-errors boolean N Only errors are displayed; other response values are not displayed. -
--no-progress boolean N File transfer progress not displayed Not applicable if --quite or --only-show-erros is specified
--page-size <value> integer N Specify the number of listings for each response. Up to 1000 supported
--ignore-glacier-warnings boolean N Warning not displayed regarding unsupported changes (copying, downloading, moving, etc.) to object in Deep Archive -
--metadata <value> string N Set up metadata to store with the object. -
--copy-props <value> string N Set the property values to be copied from the original object. Only applicable when copying from Ncloud Storage to Ncloud Storage
--metadata-directive <value> string N Set the x-amz-metadata-directive header for the CopyObject operation. If this option is enabled, --copy-props is disabled.
--size-only boolean N Apply to determine sync based on key size only. -
--exact-timestamps boolean N When syncing locally from Ncloud Storage, exclude objects whose timestamps exactly match those of objects of the same size in Ncloud Storage. -
--delete boolean N Set objects that exist in the sync destination bucket or directory but not in the original bucket or local directory to be deleted during sync. -
--debug boolean N Use debug logging. -
--no-verify-ssl boolean N Redefine the default behavior for validating SSL certificates. -
--no-paginate boolean N Disable automatic pagination, call only the first page for results. -
--output <value> string N Specify the format of call results. Available options
- json
- text
- table
- yaml
- yaml-stream
--query <value> string N JMESPath query to use for filtering response data -
--profile <value> string N Use a specific profile in the credentials file. -
--region <value> string N Specify the Region. Only KR is supported.
--color <value> string N Set output color. Available options
- on
- off
- auto
--no-sign-request boolean N Disable credential loading. -
--ca-bundle <value> string N Specify the CA certificate to use when verifying SSL certificates. -
--cli-read-timeout <value> int N Maximum read time; entering 0 changes it to a blocked status instead of a timeout. It is set to 60 seconds by default.
--cli-connect-timeout <value> int N Maximum connection time; entering 0 changes it to a blocked status instead of a timeout. It is set to 60 seconds by default.
--no-cli-pager boolean N Disable the CLI pager for response values. -
--cli-auto-prompt boolean N Enable automatic prompting for CLI input parameters. -
--no-cli-auto-prompt boolean N Disable automatic prompting for CLI input parameters. -

Examples

This section describes an example of calling and responding to the sync command.

Sync specified Ncloud Storage bucket to another bucket

Call examples

If you specify the source bucket and destination bucket to be synced and call the command, the objects in the source bucket will be copied and synced. At this time, only objects stored in the Standard Class or restored Deep Archive Class will be copied. The following is a call example.

aws s3 sync s3://bucket-aa s3://bucket-sync --endpoint-url=http://kr.ncloudstorage.com

Response example

The response example is as follows:

copy: s3://bucket-aa/log-2412/241202120123.txt to s3://bucket-sync/log-2412/241202120123.txt
copy: s3://bucket-aa/image4.png to s3://bucket-sync/image4.png    
copy: s3://bucket-aa/image3.png to s3://bucket-sync/image3.png    
warning: Skipping file s3://bucket-aa/log-2412/image.png. Object is of storage class GLACIER. Unable to perform copy operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 copy help for additional parameter options to ignore or force these transfers.
warning: Skipping file s3://bucket-aa/log-2412/image2.png. Object is of storage class GLACIER. Unable to perform copy operations on GLACIER objects. You must restore the object to be able to perform the operation. See aws s3 copy help for additional parameter options to ignore or force these transfers.

Sync local objects to specified Ncloud Storage bucket and delete all objects that do not match

Call examples

If you call the command using the --delete option, objects that do not exist in the source can be deleted from the sync destination bucket or directory.

aws s3 sync ./sync/ s3://bucket-sync --endpoint-url=http://kr.ncloudstorage.com --delete 

Response example

The response example is as follows:

delete: s3://bucket-sync/image.png
delete: s3://bucket-sync/image2.png                            
upload: sync/image/4.png to s3://bucket-sync/image/4.png        
upload: sync/image/1.png to s3://bucket-sync/image/1.png        
delete: s3://bucket-sync/log-2412/241201120224.txt              
delete: s3://bucket-sync/log-2412/241203120012.txt                                
upload: sync/document/1.pdf to s3://bucket-sync/document/1.pdf  
delete: s3://bucket-sync/ncs_5.png                            
delete: s3://bucket-sync/ncloudstorage5.pptx                  

Sync all objects stored in Ncloud Storage bucket to local directory, excluding objects under specific prefix

Call examples

--recursive option allows you to query all objects under the prefix, and --summarize option allows you to check the total number and size of objects stored in the bucket or under a specific prefix. The following is a call example.

 aws s3 sync s3://bucket-sync ./ncs/ --endpoint-url=http://kr.ncloudstorage.com --exclude "*document/*" 

Response example

The response example is as follows:

download: s3://bucket-sync/test.txt to ncs/test.txt              
download: s3://bucket-sync/test2.txt to ncs/test2.txt            
download: s3://bucket-sync/test3.txt to ncs/test3.txt            
download: s3://bucket-sync/image/4.png to ncs/image/4.png         
download: s3://bucket-sync/image/1.png to ncs/image/1.png