Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Errro when trying to copy from S3 using AWS CLI 2 the following arguments are required: paths

Tags:

aws-cli

I am trying to download files from S3 bucket I am using AWS CLI 2 and I am getting the following error. Not sure what "paths" is

aws s3 cp s3://my-bucket/my-folder --exclude "*" --include "*2020-06*" --recursive --profile mfa --region us-east-1

usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help
aws: error: the following arguments are required: paths
like image 780
kumar Avatar asked Jul 31 '20 02:07

kumar


People also ask

How to solve following arguments are required - paths error in AWS S3?

In order to solve the "Following Arguments are Required - Paths" error, set the path argument in the call to aws s3 cp. When copying an S3 object to a local file, use the following syntax:

How to recursively upload or download (copy) files with AWS S3 CP?

How to Recursively upload or download (copy) files with AWS S3 CP command When passed with the parameter --recursive the aws s3 cp command recursively copies all objects from source to destination. It can be used to download and upload large set of files from and to S3.

What is AWS S3 and s3api?

Setting the Access Control List (ACL) while copying an S3 object What is AWS S3 and S3API The AWS CLI provides two tiers of commands for accessing Amazon S3 The s3 tier consists of high-level commands that simplify performing common tasks, such as creating, manipulating, and deleting objects and buckets.

What can I do with the AWS CLI?

It enables you to carry out advanced operations that might not be possible with the following tier's high-level commands alone. The AWS CLI supports copying, moving, and syncing from Amazon S3 to Amazon S3 using the server-side COPY operation provided by Amazon S3.


1 Answers

The usage of aws s3 cp is:

aws s3 cp <LocalPath> <S3Uri> or <S3Uri> <LocalPath> or <S3Uri> <S3Uri>

You need to specify your <LocalPath>, it should be:

aws s3 cp s3://my-bucket/my-folder YOUR_LOCAL_PATH ...

Ref: https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html

like image 188
LiuChang Avatar answered Oct 11 '22 20:10

LiuChang