I'm required to archive around 200 AWS S3 buckets to S3 Glacier and I would like to do it automatically but I can't find how it can be done with aws-cli.

The only method I found, is through AWS UI... to go to each bucket manually and within it, to mark each directory -> right click and choose "change storage type" and choose Glacier.

Does anyone have any experience with this?

$ aws s3 cp s3://bucketname s3://bucketname --recursive --storage-class GLACIER

Be aware that there is a cost to transition objects to the Glacier storage class (approximately US$0.05 per 1,000 transition requests, dependent on region, so changing 1,000,000 objects to Glacier would cost approximately US$50).

| improve this answer | |

You could also set up lifecycle policies on the buckets so that they automatically transition to Glacier after x amount of days:


| improve this answer | |

I think aws cli with s3 ls, s3 mv and --storage-class should do the job.



It should be possible to use the same source and destination with mv.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.