复制很多文件 - Swift

发布于 2025-01-24 22:57:51 字数 188 浏览 2 评论 0原文

我在OVH上拥有对象存储容器。我找到了如何将文件从一个容器复制到另一个容器:

swift copy -d /"Destination container" "Initial container" "File"

它有效,但是我想复制数百个文件。您知道如何复制文件夹中的许多文件吗?

谢谢

I own Object Storage containers at OVH. I found how to copy a file from one container to another:

swift copy -d /"Destination container" "Initial container" "File"

It works, but I want to copy hundreds of files. Do you know how to copy a lot of files that are in a folder ?

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深海不蓝 2025-01-31 22:57:51

OpenStack Swift API没有复制多个对象的方法。 putget复制方法均在单个对象上操作。

因此,您必须循环浏览源容器的列表,然后一次复制每个文件。您可以使用shell脚本和swift命令执行此操作,也可以使用Swift API库之一和一些自定义代码(例如,在Python中)。

另外,您可以使用rclone link )或潜在的cyberduck ( link )。这些工具显然不使用复制方法,因此该副本将需要额外的转移步骤,并且可能比您编写脚本来完成这项工作的情况更长。

The OpenStack Swift API doesn't have methods to copy multiple objects. The PUT, GET and COPY methods all operate on single objects.

So you have to loop over a listing of the source container, and copy each file one at a time. You can do this using a shell script and the swift command, or using one of the Swift API libraries and some custom code (e.g. in Python).

Alternatively you could use rclone (link) or potentially cyberduck (link). These tools apparently don't use the COPY method so the copy will entail extra transfer steps and may take longer overall than if you wrote a script to do the job.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文