gpt4 book ai didi

amazon-web-services - 从 aws cp 中排除目录

转载 作者:行者123 更新时间:2023-12-03 09:13:19 24 4
gpt4 key购买 nike

Mac 计算机上的当前项目目录包含一些文件和目录,需要复制到 aws s3 存储桶,但没有一些目录,其中一些目录是隐藏的。
我无法从the docs中弄清楚如何做到这一点,因此我的猜测是:

aws> s3 cp . s3://bucketName --recursive --exclude "how to put the list of directories to exclude here"?

谢谢

最佳答案

Amazon S3 并不真正支持目录。相反,目录名称(“路径”)被添加到文件名称之前。

所以,想象一下这个结构:

docs
+ foo
+ bar
+ foobar

如果您希望复制整个 docs 目录,但跳过 bar 目录,请在 docs 目录中使用以下命令:

aws s3 cp . s3://mybucket --recursive --exclude 'bar/*'

这告诉它复制所有文件,除了bar/ 开头的文件。

关于amazon-web-services - 从 aws cp 中排除目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39879330/

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