I can't find a command example for archiving a set of files from a given prefix in S3 into a given vault in Glacier using ONLY COMMAND LINE, i.e. no Lifecycles, no python+boto. Thanks.
This doc has a lot of examples but none fit my request: https://docs.aws.amazon.com/cli/latest/reference/s3/mv.html
You're looking for this:
https://aws.amazon.com/premiumsupport/knowledge-center/restore-s3-object-glacier-storage-class/
aws s3 cp s3://bucketname/key/file s3://bucketname/key/file --storage-class GLACIER
optionally use --recursive instead of a specific file name.
That's because you can't. As described in the Amazon's S3 Documentation:
You cannot specify GLACIER as the storage class at the time that you create an object. You create GLACIER objects by first uploading objects using STANDARD, RRS, or STANDARD_IA as the storage class. Then, you transition these objects to the GLACIER storage class using lifecycle management.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With