【发布时间】:2016-08-10 17:30:58
【问题描述】:
我正在使用 swift CLI 并尝试从容器中下载多个对象。
我可以这样做
for i in `swift list container -p object/201505`; do swift download container $i; done
问题是我需要搜索和下载所有匹配的多个对象。我试过用一个小脚本来做。
#!/bin/bash
while read objects;
SAMPLE=$(swift list container objects);
do
for i in $SAMPLE; do `swift download container $i`; done
done < samples_list
但我总是收到以下问候。
Usage: swift [options] list [options] [container]
Lists the containers for the account or the objects for a container. -p or
--prefix is an option that will only list items beginning with that prefix.
-d or --delimiter is option (for container listings only) that will roll up
items with the given delimiter (see Cloud Files general documentation for
what this means).
我的变量没有被读取吗?如何仅下载具有我设置的正确前缀的文件?
【问题讨论】:
标签: bash openstack openstack-swift