Showing posts with label AWS S3 Glacier. Show all posts
Showing posts with label AWS S3 Glacier. Show all posts

Friday, August 5, 2022

Transfer directory from EFS to S3 Glacier

1. Create an S3 bucket
> aws s3 mb s3://rv398-20220712

2. Copy EFS files to the S3 bucket
> aws s3 cp /mnt/efs/Joana3/Data s3://rv398-20220712/Data --recursive

3. Change bucket lifecycle
> cat lifecycle.json
{
  "Rules": [ 
    { 
      "ID": "Move to Glacier (all objects in bucket)", 
      "Prefix": "", 
      "Status": "Enabled", 
      "Transition": { 
        "Days": 0, 
        "StorageClass": "GLACIER" 
      } 
    } 
  ] 
}
> aws s3api put-bucket-lifecycle --bucket rv398-20220712 \\
--lifecycle-configuration file://lifecycle.json

Note: It will take up to 24 hours for the file to be stored in Glacier


Transfer directory from EFS to S3 Glacier

1. Create an S3 bucket > aws s3 mb s3://rv398-20220712 2. Copy EFS files to the S3 bucket > aws s3 cp /mnt/efs/Joana3/Data s3://rv398-...