Friday, March 5, 2021

upload data in s3 Glacier via aws cli


Amazon S3 Glacier is a aws storage service, that is use for storing the data for long term.

S3 Glacier vault inventory is only updated once a day. When you upload an archive, you will not immediately see the new archive added to your vault (in the console or in your downloaded vault inventory list) until the vault inventory has been updated.

S3 Glacier Data is stored in "archives." An archive can be any data such as a photo, video, or document. You can upload a single file as an archive or aggregate multiple files into a TAR or ZIP file and upload as one archive.

 

Step 1) Install AWS cli & python-pip in ubuntu 

$ sudo apt-get install awscli
$ sudo apt-get install python-pip

 


Step 2) Write the IAM user_access_key ID and secret_access_key, region and enter.

$ aws configure



Note:- S3 Glacier vault inventory is only updated once a day.

 

Command 1) Create S3 Glacier Vault

$ aws glacier create-vault --account-id - --vault-name my-vault-name

Command 2) Check that the vault was created successfully

$ aws glacier describe-vault --account-id - --vault-name my-vault-name

Command 3) Upload a file to the vault

$ aws glacier upload-archive --vault-name my-vault-name --account-id - --archive-description "my-test-archive-description" --body test.txt

Command 4) Request an inventory of the vault

$ aws glacier initiate-job --account-id - --vault my-vault-name --job-parameters '{ "Type": "inventory-retrieval" }'

Command 5) Get a list of the current jobs

$ aws glacier list-jobs --account-id - --vault-name my-vault-name

No comments:

Post a Comment

testing