Melinda
Melinda

Reputation: 1531

Need to upload/copy ALL files from specific local directory to AWS S3 bucket using AWS CLI on Ubuntu 22.04

I am working on an Ubuntu 22.04 desktop using AWS CLI. I am trying to upload ALL files located in a specific local directory to our S3 bucket using AWS CLI but I'm getting an error. Here is my command and the error:

ms@ms01:~$ aws s3 cp /home/ms/Downloads/TWU/mp3/ s3://abc.org/v2/ –-recursive

The error I'm getting is: Unknown options: --recursive

Any help/direction would be appreciated. Thanks.

Upvotes: 1

Views: 2092

Answers (2)

Amir nazary
Amir nazary

Reputation: 695

You might be using an old version of awscli. Try Updating it through:
pip install awscli -U

Upvotes: 0

John Rotenstein
John Rotenstein

Reputation: 269101

Try putting --recursive earlier in the command:

aws s3 cp --recursive /home/ms/Downloads/TWU/mp3/ s3://abc.org/v2/

Alternatively, the sync command always includes all sub-directories and only copies files that are not already in the destination (so it can be run multiple times to only copy new/changed files):

aws s3 sync /home/ms/Downloads/TWU/mp3/ s3://abc.org/v2/

Upvotes: 3

Related Questions