Can s3cmd retrieve metadata of an object on Amazon S3?

回眸只為那壹抹淺笑 提交于 2020-01-14 14:45:29

问题


With s3cmd sync command I can backup encrypted files on S3 to local storage. When trying to restore these files back to S3 I have to set metadata like x-amz-meta-x-amz-key and x-amz-meta-x-amz-iv for each file. My question is how to use s3cmd for retrieve metadata of an object on Amazon S3?


回答1:


Upstream github.com/s3tools/s3cmd master branch has this commit now which does emit all metadata in the info command.

commit 36352241089e9b9661d9ee586dc19085f4bb13c9 Author: Andrew Gaul Date: Tue Mar 10 04:36:04 2015 -0700

Emit user metadata in object info



回答2:


I couldn't find a built in way to get the Cache-Control headers for an object using s3cmd specifically. s3cmd info doesn't seem to include that information.

However using the --debug flag I was able to see all the headers:

$ s3cmd --debug info s3://ninja-gant-rob/styles.ea647039fe7f7c99fe55.css 2>&1 | grep -i 'cache-control'
             'cache-control': 'max-age=31536000',


来源:https://stackoverflow.com/questions/21121262/can-s3cmd-retrieve-metadata-of-an-object-on-amazon-s3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!