- 最新
- 投票最多
- 评论最多
Hello.
As far as I know, WinSCP does not allow restore of S3 objects stored in Glacier Deep Archive.
https://winscp.net/eng/docs/guide_amazon_s3
WinSCP is primarily a file transfer software and it does not support the required operations needed for transitioning with S3 storage classes such as Glacier Deep Archive. Possible approach will be a combination of using AWS CLI with WinSCP where - to upload, move the objects into S3 using WinSCP and then use AWS CLI to change the storage class. and restore objects using AWS CLI into S3 standard bucket and then use WinSCP to transfer the files.
Hi @Mrity - Thank you for your suggestion, that might work. Would you be able to share some sample commands in AWS CLI for:
- Changing Storage Class
- Initiate RESTORE with BULK Retrieval and set the Number of days that the restored copy is available to 10 Days
Currently, WinSCP does not natively support initiating a restore for files stored in S3 Glacier Deep Archive directly through its GUI. WinSCP is primarily designed for file transfer protocols and does not have built-in functionality to interact with the more advanced features of AWS S3 storage classes, like Glacier Deep Archive.
To restore files from Glacier Deep Archive, you typically need to use the AWS Management Console, AWS CLI, or SDKs that support initiating a restore request.
Hi @Giovanni, Thank you for your input. This is a solid feedback. Do you happen to know if it's possible to create a script for WinSCP to trigger CLI to initiate a RESTORE?
For changing the Storage Class using aws cli, you could either use "aws s3 cp" or "aws s3 mv" commands. The cp command will create a new copy of the object and set the new Storage Class for it, in this case, you need to ensure that the original object is then handled appropriately. While the mv command will updat storage class of the object without duplicating the object. e.g. - aws s3 mv s3://BUCKET_NAME/OBJECT_KEY s3://BUCKET_NAME/OBJECT_KEY --storage-class STORAGE_CLASS Replace BUCKET_NAME with the name of your S3 bucket. Replace OBJECT_KEY with the path and filename of the object you want to change the storage class for. Replace STORAGE_CLASS with the desired storage class, such as STANDARD, GLACIER, DEEP_ARCHIVE, etc.
**Refer the AWS CLI documentation ** - https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3/mv.html
Similarly for restoring the object, there are several methods. E.g. on aws cli - aws s3api restore-object --bucket DOC-EXAMPLE-BUCKET --key dir1/example.obj --restore-request '{"Days":10,"GlacierJobParameters":{"Tier":"Standard"}}' refer the documentation here - https://docs.aws.amazon.com/AmazonS3/latest/userguide/restoring-objects.html#restore-archived-objects https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/restore-object.html
If you are looking to perform this operation at large scale, then recommendation will be to use the S3 Lifecycle policies to automatically transition objects between storage classes, without the need to manually run the “aws s3 cp” command. This can be a more scalable and automated approach to managing your S3 storage class transitions. Also, from a restore object perspective, using S3 batch operations can be efficient as well. Refer - https://docs.aws.amazon.com/AmazonS3/latest/userguide/batch-ops-initiate-restore-object.html
相关内容
- AWS 官方已更新 3 年前
Hi @Riku, Thanks for your input. How about Uploading via WinSCP, is there a way to set the Storage Class to Deep Archive instead of Standard while uisng WinSCP?