复制很多文件 - Swift
我在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
OpenStack Swift API没有复制多个对象的方法。
put
,get
和复制
方法均在单个对象上操作。因此,您必须循环浏览源容器的列表,然后一次复制每个文件。您可以使用shell脚本和
swift
命令执行此操作,也可以使用Swift API库之一和一些自定义代码(例如,在Python中)。另外,您可以使用
rclone
( link )或潜在的cyberduck ( link )。这些工具显然不使用
复制
方法,因此该副本将需要额外的转移步骤,并且可能比您编写脚本来完成这项工作的情况更长。The OpenStack Swift API doesn't have methods to copy multiple objects. The
PUT
,GET
andCOPY
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 potentiallycyberduck
(link). These tools apparently don't use theCOPY
method so the copy will entail extra transfer steps and may take longer overall than if you wrote a script to do the job.