Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to copy one file with Amazon S3 CLI

I made a folder with 3 .jpg files in it to test. This folder is called c:\Work\jpg.

I am trying to upload it to a bucket with this command:

aws s3 cp . s3://{bucket}/Test

I get the following every time:

[Errno 2] No such file or directory: "C:\Work\jpg\".

Obviously, it correctly translated the current folder "." into the correct folder, but then it says it doesn't exist?!?

Any help out there to simply copy 3 files?

like image 508
PRMan Avatar asked May 21 '18 19:05

PRMan


People also ask

How do I transfer files from S3 to local using aws CLI?

You can use cp to copy the files from an s3 bucket to your local system. Use the following command: $ aws s3 cp s3://bucket/folder/file.txt .

How do I download from S3 bucket to aws CLI?

To download an entire bucket to your local file system, use the AWS CLI sync command, passing it the s3 bucket as a source and a directory on your file system as a destination, e.g. aws s3 sync s3://YOUR_BUCKET . . The sync command recursively copies the contents of the source to the destination.


1 Answers

Are you confusing aws s3 sync with aws s3 cp. For copy, you need to specify the source file. The destination file can be current directory.

aws s3 cp test.txt s3://mybucket/test2.txt
like image 88
helloV Avatar answered Sep 24 '22 11:09

helloV