5
votes

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

1
Maybe because there's no --recursive parameter, considering the documentationCid

1 Answers

17
votes

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.