我可以使用s3cmd mv命令将对象移至S3存储桶中的“文件夹"吗? [英] Can I move an object into a 'folder' inside an S3 bucket using the s3cmd mv command?

查看:430
本文介绍了我可以使用s3cmd mv命令将对象移至S3存储桶中的“文件夹"吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为Linux安装了s3cmd命令行工具.将文件放入存储桶效果很好.但是,我想将文件移到文件夹"中.我知道S3本身不支持文件夹,但是我的Cyber​​duck GUI工具将它们很好地转换为我可以查看备份.

I have the s3cmd command line tool for linux installed. It works fine to put files in a bucket. However, I want to move a file into a 'folder'. I know that folders aren't natively supported by S3, but my Cyberduck GUI tool converts them nicely for me to view my backups.

例如,我在存储桶的根目录中有一个名为"test.mov"的文件,我想将其移至"idea"文件夹.我正在尝试:

For instance, I have a file in the root of the bucket, called 'test.mov' that I want to move to the 'idea' folder. I am trying this:

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

但是我得到一些奇怪的错误,例如:

but I get strange 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'

文件夹名称也不是

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

是否有一种方法可以删除并重新命名此3GB文件?

Is there a way within having to delete and reput this 3GB file?

更新:仅供参考,我可以将新文件直接放入这样的文件夹中:

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

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

但是仍然不知道如何移动它们....

But still don't know how to move them around....

推荐答案

要从一个存储桶移动/复制到另一个存储桶或另一个存储桶,我使用了s3cmd工具,效果很好.例如:

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

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

这篇关于我可以使用s3cmd mv命令将对象移至S3存储桶中的“文件夹"吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆