Can I move a file to a “folder” inside an S3 bucket using the s3cmd mv command?

I have an s3cmd command line tool for Linux. It works great to put files in a bucket. However, I want to move the file to a folder. I know that folders are not supported by S3, but my Cyberduck GUI tool perfectly converts them to view my backups.

Currently, I have a file in the root directory, for example, "test.mov". I want to move it to the idea folder. I try this:

s3cmd mv s3://mybucket/test.mov s3://mybucket/idea/test.mov 

but I get weird errors like:

 WARNING: Retrying failed request: /idea/test.mov (timed out) WARNING: Waiting 3 sec... 

I also tried quotes, but that didn't help either:

 s3cmd mv 's3://mybucket/test.mov' 's3://mybucket/idea/test.mov' 

not only folder name

 s3cmd mv 's3://mybucket/test.mov' 's3://mybucket/idea/' 

Is there any way to delete and download this 3GB file?

Update : just FYI, I can put the new files directly into a folder like this:

 s3cmd put test2.mov s3://mybucket/idea/test2.mov 

But still do not know how to move them ....

+6
source share
3 answers

To move / copy from one bucket to another or the same bucket, I use the s3cmd tool and it works fine. For instance:

 s3cmd cp --r s3://bucket1/directory1 s3://bucket2/directory1 s3cmd mv --recursive s3://bucket1/directory1 s3://bucket2/directory1 
+7
source

Your file is probably quite large, try increasing the socket_timeout s3cmd configuration setting

http://sumanrs.wordpress.com/2013/03/19/s3cmd-timeout-problems-moving-large-files-on-s3-250mb/

0
source

Remove characters. Your code should be:

 s3cmd mv s3://mybucket/test.mov s3://mybucket/idea/test.mov 

Also try what permissions of your bucket - for your username you must have all permissions.

Also try connecting CloudFront to your bucket. I know this doesn't make sense, but I have a similar problem with a bucket that does not have a cloudfront instance associated with it.

-1
source

Source: https://habr.com/ru/post/918164/


All Articles