0

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?

1
$ 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 | |
2

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

https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-lifecycle.html

| improve this answer | |
1

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

https://docs.aws.amazon.com/cli/latest/reference/s3/ls.html

https://docs.aws.amazon.com/cli/latest/reference/s3/mv.html

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.