【发布时间】:2016-12-19 14:32:10
【问题描述】:
使用CLI(不是s3cmd)管理Amazon S3,如何选择扩展名为.pdf的所有对象并应用内容类型application/pdf?
这是我目前想出的:
aws s3 sync s3://${BUCKET_NAME} s3://${BUCKET_NAME}
--dryrun
--exclude '*'
--include '*.pdf'
--no-guess-mime-type
--content-type application/pdf
使用--debug 参数我发现了这个错误:
An error occurred (InvalidRequest) when calling the CopyObject operation:
This copy request is illegal because it is trying to copy an object to itself
without changing the object's metadata, storage class,
website redirect location or encryption attributes.
【问题讨论】:
-
你能在没有选项的情况下尝试你的命令吗?然后一一添加选项,看看什么时候失败?
-
@Sylwit 我使用了 --debug 参数,发现错误并更新问题。
标签: amazon-web-services amazon-s3 aws-cli