user3195271
user3195271

Reputation: 29

Can s3cmd retrieve metadata of an object on Amazon S3?

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?

Upvotes: 3

Views: 3193

Answers (2)

Rob
Rob

Reputation: 3746

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',

Upvotes: 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: 1

Related Questions