作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将多个文件从本地上传到AWS S3存储桶,
我可以使用aws s3 cp
一对一地复制文件,
但是我需要上传多个而不是全部。选择性文件到同一S3文件夹,
是否可以在单个AWS CLI调用中执行此操作(如果可以)?
例如-
aws s3 cp test.txt s3://mybucket/test.txt
最佳答案
如果向下滚动到标题为“将本地文件递归复制到S3”部分的文档链接,则会看到以下内容:
When passed with the parameter --recursive, the following cp command recursively copies all files under a specified directory to a specified bucket and prefix while excluding some files by using an --exclude parameter. In this example, the directory myDir has the files test1.txt and test2.jpg
.txt
文件复制到S3中的同一存储桶中,则可以尝试执行以下操作:
aws s3 cp yourSubFolder s3://mybucket/ --recursive
--exclude
和
--include
参数(否则将上传所有文件):
aws s3 cp yourSubFolder s3://mybucket/ --recursive --exclude "*" --include "*.txt"
关于amazon-web-services - AWS : How to copy multiple file from local to s3?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57765350/
我是一名优秀的程序员,十分优秀!