如何使用S3使用Include模式复制文件,并在文件名上下划线

发布于 2025-02-11 20:02:10 字数 614 浏览 0 评论 0原文

如何将_(下划线)包含在包含模式中?

我有一个带有以下格式的文件的S3存储桶

20220630_084021_abc.json
20220630_084031_def.json
20220630_084051_ghi.json
20220630_084107_abc.json
20220630_084118_def.json

,因此,我想获取以20220630_0840*开头的所有文件。 因此,我尝试使用“包含模式”上的多个变体来获取它们,到目前为止,我都使用了以下内容:

 aws s3 cp s3://BUCKET/ LocalFolder  --include "20220630_0840*" --recursive
 aws s3 cp s3://BUCKET/ LocalFolder  --include "[20220630_0840]*" --recursive
 aws s3 cp s3://BUCKET/ LocalFolder  --include "20220630\_0840*" --recursive

没有一个真正起作用的是,我从20220630

How can I include the _ (underscore) on the include pattern?

I have a S3 bucket with files with the following format

20220630_084021_abc.json
20220630_084031_def.json
20220630_084051_ghi.json
20220630_084107_abc.json
20220630_084118_def.json

So, I would like to get all the files that start with 20220630_0840*.
So, I've tried to fetch them using multiple variations on the include pattern, so far I had used the followings:

 aws s3 cp s3://BUCKET/ LocalFolder  --include "20220630_0840*" --recursive
 aws s3 cp s3://BUCKET/ LocalFolder  --include "[20220630_0840]*" --recursive
 aws s3 cp s3://BUCKET/ LocalFolder  --include "20220630\_0840*" --recursive

None of them really work I'm getting all the files that have their name starting with 20220630

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文