I need to change storage class of a s3 object from STANDARD class into STANDARD_IA using s3cmd. Can anybody help me to do this task. Thanks in advance.
Using s3cmd:
s3cmd cp s3://BUCKET/KEY s3://BUCKET/KEY --storage-class=STANDARD_IA
Using AWS CLI:
aws s3 cp s3://BUCKET/KEY s3://BUCKET/KEY --storage-class STANDARD_IA
WARNING: If Versioning is on, this does not change the storage class of the object. It creates a new object with the requested storage class (e.g. STANDARD_IA), but keeps the original version in whatever storage class it was uploaded (e.g. STANDARD). You'll be paying for both copies.
If you want to change the storage class on all objects within a bucket use:
aws s3 cp s3://<bucket-name>/ s3://<bucket-name>/ --recursive --storage-class <storage_class>
--storage-class (string) The type of storage to use for the object. Valid choices are: STANDARD | REDUCED_REDUNDANCY | STANDARD_IA | ONEZONE_IA | INTELLIGENT_TIERING | GLACIER | DEEP_ARCHIVE. Defaults to 'STANDARD'
Source: cp @ AWS CLI Command Reference
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