biegel
biegel

Reputation: 570

Can s3cmd or AWS CLI read object metadata?

Setting metadata via HTTP headers using s3cmd is straightforward enough:

$> s3cmd put --add-header=x-amz-custom-header:true file.txt s3://bucket/

However, it looks like there's no way to read these headers (or some of Amazon's default immutable headers) through s3cmd:

$> s3cmd ls s3://bucket/
2015-03-13 17:51       16   s3://bucket/file.txt

$> s3cmd info s3://bucket/file.txt
s3://bucket/file.txt (object):
File size: 16
Last mod:  Fri, 13 Mar 2015 17:51:28 GMT
MIME type: application/x-empty
MD5 sum:   de09180z0f00b999e5460998e44981a
SSE:       NONE
policy: none
ACL:       aws: FULL_CONTROL

Is there no way to read object metadata through the command line?

Maybe I'm misunderstanding what the general uses of object metadata are.

(this is basically a more generic version of this unanswered question: Can s3cmd retrieve metadata of an object on Amazon S3?)

Upvotes: 1

Views: 2798

Answers (1)

Matt Domsch
Matt Domsch

Reputation: 486

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

Upvotes: 2

Related Questions