【发布时间】:2014-09-25 00:58:10
【问题描述】:
我有一个 S3 存储桶,其中存储了几个具有以下格式的日志文件 index.log.yyyy-mm-dd-01 index.log.yyyy-mm-dd-02 . . .
yyyy 表示年份,mm 表示月份,dd 表示日期。
现在我只想下载其中的几个。我看到了Downloading an entire S3 bucket?。如果我想下载整个存储桶,这篇文章的公认答案绝对可以正常工作,但是如果我想做一些模式匹配,我应该怎么做?我尝试了以下命令,但没有奏效:
aws s3 sync s3://mybucket/index.log.2014-08-01-* .
aws s3 sync 's3://mybucket/index.log.2014-08-01-*' .
我还尝试使用 s3cmd 进行下载,使用 http://fosshelp.blogspot.in/2013/06 文章的 POINT 7 和 http://s3tools.org/s3cmd-sync。以下是我运行的命令:
s3cmd -c myconf.txt get --exclude '*.log.*' --include '*.2014-08-01-*' s3://mybucket/ .
s3cmd -c myconf.txt get --exclude '*.log.*' --include '*.2014-08-01-*' s3://mybucket/ .
还有一些其他的排列方式。
谁能告诉我为什么没有发生模式匹配?或者如果我需要使用任何其他工具。
谢谢!!
【问题讨论】:
标签: amazon-web-services amazon-s3 command-line-interface s3cmd