glaciercmd icon indicating copy to clipboard operation
glaciercmd copied to clipboard

Support for Glacier restore to S3 bucket

Open LordGaav opened this issue 12 years ago • 0 comments

Request via email:

There is an option in S3 to send files to glacier via the Amazon console. From what I can see Amazon maintains the vault for this internally. It would be nice if your code could at least do restores to such files.

If you could add something like this to you code it would probably be useful.

In: aws-java-sdk/aws-java-sdk-1.3.27/samples/AmazonS3/S3Sample.java These are the lines I added : (After chopping out most of the sample code)

        String bucketName = "something_bucket_name";
        String key = "/Sat:WY:36/compname/blabla/something_name";
         int experationInDays = 3;

            /*
             * Restore the object from glacier;
             */
            System.out.println("Restoring the S3 object: " + bucketName + ":" +
                key + "for " + experationInDays + " days.\n");
            s3.restoreObject(bucketName, key, experationInDays);

LordGaav avatar Jan 14 '13 08:01 LordGaav