gpt4 book ai didi

amazon-web-services - 'aws s3 sync' 仅复制具有特定扩展名的文件

转载 作者:行者123 更新时间:2023-12-05 01:40:13 24 4
gpt4 key购买 nike

我有一个 S3 存储桶,我想从中复制:

  1. 整个目录结构(所有目录和子目录,长度不限)
  2. 无论它们在目录结构中的什么位置,所有匹配特定文件名路径的文件(例如:*.log*070719*.csv 等。 )

有什么方法可以从 AWS CLI 执行此操作吗?

最佳答案

是的,你可以。

查看 AWS CLI 文档:Use of Exclude and Include Filters :

Currently, there is no support for the use of UNIX style wildcards in a command's path arguments. However, most commands have --exclude "<value>" and --include "<value>" parameters that can achieve the desired result. These parameters perform pattern matching to either exclude or include a particular file or object.

For example, if the filter parameters passed to the command were:

--exclude "*" --include "*.txt"

All files will be excluded from the command except for files ending with .txt.

关于amazon-web-services - 'aws s3 sync' 仅复制具有特定扩展名的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56894349/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com