从s3存储桶复制多个文件 [英] Copy multiple files from s3 bucket
本文介绍了从s3存储桶复制多个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法将多个文件从AWS S3存储桶下载到本地计算机.
I am having trouble downloading multiple files from AWS S3 buckets to my local machine.
我拥有要下载的所有文件名,并且我不希望其他文件名.我怎样才能做到这一点 ?我可以做一些迭代的aws-cli中是否有任何循环?
I have all the filenames that I want to download and I do not want others. How can I do that ? Is there any kind of loop in aws-cli I can do some iteration ?
我需要下载数百个文件,因此似乎无法使用一个以所有文件名作为参数的命令.
There are couple hundreds files I need to download so that it seems not possible to use one single command that takes all filenames as arguments.
推荐答案
有一个bash脚本,可以从文件filename.txt
中读取所有文件名.
There is a bash script which can read all the filenames from a file filename.txt
.
#!/bin/bash
set -e
while read line
do
aws s3 cp s3://bucket-name/$line dest-path/
done <filename.txt
这篇关于从s3存储桶复制多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文