0

I am trying to retrieve a zip folder from my S3 Glacier storag. The zip i want inside a bucketname > backups > 11-1-2018 > only one file lives here master.meta. So the zip folders has been archived.

Below is the code I am using to access and retrieve the zip i want. When I run this It fires properly but I keep getting this message "The Archive ID was not found: " I have searched to no avail on how to obtain this HIDDEN ARCHIVE ID...

    static string vaultName = "XXXXX";
    static string archiveId = "????????????????????";

    static string downloadFilePath = "D:";
    public static void Main(string[] args)
    {

        AWSCredentials credentials = new BasicAWSCredentials("", "");
        AmazonS3Config config = new AmazonS3Config();
        config.ServiceURL = "XXXXX.s3.amazonaws.com";
        config.RegionEndpoint = Amazon.RegionEndpoint.GetBySystemName("us-west-2");
        IAmazonS3 s3Client = new AmazonS3Client(credentials, config);
        try
        {
            var manager = new ArchiveTransferManager(Amazon.RegionEndpoint.USWest2);

            var options = new DownloadOptions();
            options.StreamTransferProgress += ArchiveDownloadHighLevel.progress;
            // Download an archive.
            Console.WriteLine("Intiating the archive retrieval job and then polling SQS queue for the archive to be available.");
            Console.WriteLine("Once the archive is available, downloading will begin.");
            manager.Download(vaultName, archiveId, downloadFilePath, options);
            Console.WriteLine("To continue, press Enter");
            Console.ReadKey();
        }
        catch (AmazonGlacierException e) { Console.WriteLine(e.Message); }
        catch (AmazonServiceException e) { Console.WriteLine(e.Message); }
        catch (Exception e) { Console.WriteLine(e.Message); }
        Console.WriteLine("To continue, press Enter");
        Console.ReadKey();
    }
    static int currentPercentage = -1;
    static void progress(object sender, StreamTransferProgressArgs args)
    {
        if (args.PercentDone != currentPercentage)
        {
            currentPercentage = args.PercentDone;
            Console.WriteLine("Downloaded {0}%", args.PercentDone);
        }
    }

I am at a lost on how to find/get the archive id. Inside the master.meta index file I used following ids in hopes it was the archive id.

 "zipiwanttorestore" : {
         "gid" : "THIS ID DID NOT WORK", -- was a 3 digit id
         "backup_type" : 1,
         "archive_version" : 4,
         "user" : "zipiwanttodownload",
         "pkgacct_version" : 10,
         "uid" : "THIS ID DID NOT WORK"
      },



  "metadata_version" : "3.1",
   "backup" : {
      "backup_id" : "THIS ID DID NOT WORK", 
      "backup_type" : 1,
      "Date" : {
         "Hour" : 0,
         "Minute" : 0,
         "Year" : 2018,
         "Second" : 0,
         "Day" : 1,
         "Month" : 11
      },

Any help would be life saving. Thank you.

DJN
  • 153
  • 2
  • 10
  • 1
    *"So the zip folders has been archived."* I'm not sure what that is intended to mean. It sounds like the object has been deleted. – Michael - sqlbot Dec 07 '18 at 02:26
  • It took me awhile but I came to that conclusion too. They zips are deleted... D: .... My amazon S3 storage in inherited my WHM back up policies keeping only one back on the server.. initially the plan was to keep one back up on my server and dump the rest to S3. – DJN Dec 12 '18 at 19:47

0 Answers0