amazon-web-services - 使用 aws 客户端仅从单个目录复制 s3 文件(非递归)
问题描述
考虑沿这些线的 aws 存储桶/键结构
myBucket/dir1/file1
myBucket/dir1/file2
myBucket/dir1/dir2/dir2file1
myBucket/dir1/dir2/dir2file2
使用时:
aws s3 cp --recursive s3://myBucket/dir1/ .
dir2file[1,2]
然后我们将一起复制下来file[1,2]
。如何只复制后面的文件而不是子目录下的文件?
回复评论:。我对--exclude
为每个子目录放置一个不感兴趣,所以这不是从 aws cp 中排除目录的重复
解决方案
您可以使用该选项排除路径--exclude
,例如
aws s3 cp s3://myBucket/dir1/ . --recursive --exclude "dir1/dir2/*"
使用 aws cli 帮助可以找到更多选项和示例
aws s3 cp help
推荐阅读
- c++ - 虽然循环超过限制
- asp.net-mvc-routing - Asp.Net Core Scaffolded 'Register' 和 'Login' 重定向在 Azure AppService 中不起作用
- c# - 如何为多态性正确配置 swashbuckle
- python - 是否有可能通过 selenium 自动化将 HTML 标记插入驻留在服务器上的文件中?
- c++ - 堆栈上 C++ 和 Lua I/O 交互的最佳方式
- python - 计算关键字和文本文件的每个单词之间的度量
- python - 在 Pandas 条形图上使用 Dataframe 中的值注释特定条形
- node.js - Microsoft Teams Bot-Framework 技能对话框:endDialog() 不起作用
- c# - c# system.data.sqlite V 10.113.1 SQLiteConnection.ChangePassword 缺失
- python - 如何使用漂亮的汤访问 HTML 文件中的下一个元素