我在 s3 存储桶文件之间复制来自特定日期的非序列文件。 在示例中,我从 23 号复制,所以我想复制 15 号、19 号和 23 号。
aws s3 --region eu-central-1 --profile LOCALPROFILE cp s3://SRC s3://DEST --recursive --exclude "*" --include "2016-01-23"
此消息来源提到使用序列 http://docs.aws.amazon.com/cli/latest/reference/s3/ 包括。
最佳答案
您似乎在询问如何在一个命令中复制多个文件/路径。
AWS Command-Line Interface (CLI)允许多个 --include
规范,例如:
aws s3 cp s3://SRC s3://DEST --recursive --exclude "*" --include "2016-01-15/*" --include "2016-01-19/*" --include "2016-01-23/*"
第一个 --exclude
表示排除所有文件,然后后面的 --include
参数添加要包含在副本中的路径。
参见: Use of Exclude and Include Filters在文档中。
关于amazon-s3 - 如何与或 aws s3 复制语句与包含,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40355454/