Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aws s3 sync --recursive not working in windows

I am using AWS-CLI in windows cmd and run AWS s3 sync command but it does not work with --recursive, it shows unknown options: --recursive

aws s3 sync --recursive localpath s3://bucket-name

python --version python 3.6.5

aws --version aws-cli/1.15.38 Python/2.7.9 Windows/2012Server botocore/1.10.38

Please help

like image 601
Gaurav Goyal Avatar asked Jun 15 '18 11:06

Gaurav Goyal


People also ask

Is AWS S3 sync recursive?

Syncs directories and S3 prefixes. Recursively copies new and updated files from the source directory to the destination. Only creates folders in the destination if they contain one or more files.

Why am I getting an access denied error for ListObjectsV2 when I run the sync command on my Amazon S3 bucket?

Verify that you have the permission for s3:ListBucket on the Amazon S3 buckets that you're copying objects to or from. You must have this permission to perform ListObjectsV2 actions. Note: s3:ListBucket is the name of the permission that allows a user to list the objects in a bucket.

What permissions are needed for S3 sync?

To run the command aws s3 sync, then you need permission to s3:GetObject, s3:PutObject, and s3:ListBucket. Note: If you're using the AssumeRole API operation to access Amazon S3, you must also verify that the trust relationship is configured correctly.

Is AWS S3 sync incremental?

It is based on aws s3 sync , which should enable an incremental backup, instead of copying/modifying every files.


1 Answers

The aws s3 sync command is already recursive, so there is no need for a recursive option, and there isn't one:

Syncs directories and S3 prefixes. Recursively copies new and updated files from the source directory to the destination. Only creates folders in the destination if they contain one or more files.

In addition the sync command only copies things that don't already exist on the destination. If you point to a folder it will recursively sync everything inside that doesn't already exist on your target destination. This is different then the aws s3 cp command. The cp command copies whatever you tell it to, regardless of it it already exists on the target. The cp command takes a --recursive option for recursively copying folders.

like image 136
Brandon Miller Avatar answered Oct 11 '22 10:10

Brandon Miller