Search code examples
amazon-glaciercloudberry

how to set filepath for amazon glacier uploads?


Amazon Glacier does not have the concept of filepaths. However when I upload files to glacier via client tools like Cloudberry then my uploads do have a path structure.

If I am programmatically uploading an archive to Amazon Glacier, how can I upload it so it has a filepath and filename in Cloudberry? I think I may need add something to the 'x-amz-archive-description' field here http://docs.aws.amazon.com/amazonglacier/latest/dev/api-archive-post.html, but I do not know how to format it.

I am using the Amazon Javascript SDK: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html. I think I've been able to upload archives fine, though I haven't been able to see them in Cloudberry yet.

UPDATE: After getting it working, I put the code I was using here in case a sample is needed: https://github.com/fschwiet/mysql-glacier-backup


Solution

  • Our Glacier archive description metadata is a simple JSON with the following fields:

    • "Path": the full path of the source file. E.g., "c:\myfolder\myfile.txt" for file copied from local disk or "mybucket/myfolder/myfile.txt" for files copied from cloud storage like Amazon S3. The path is UTF7-encoded.
    • "UTCDateModified": ISO8601 utc date without milliseconds (format: "yyyyMMddTHHmmssZ"). This is modification date of the original file (not the archive creation date).
    • "Flags": integer flags value. 1 - compressed, 2 - encrypted.

    Thanks, Andy