AWS S3 – How to Automatically Archive AWS S3 Buckets to S3 Glacier

amazon s3amazon-glacieramazon-web-servicesaws-cli

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?

Best Answer

$ 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).

Related Topic