0

我正在尝试从我的 S3 Glacier 存储中检索一个 zip 文件夹。我想要的 zip 在 bucketname > 备份 > 11-1-2018 > 只有一个文件存在于 master.meta 中。因此 zip 文件夹已存档。

下面是我用来访问和检索我想要的 zip 的代码。当我运行它时它会正常触发,但我不断收到此消息“找不到存档 ID:”我已经搜索过如何获取此隐藏的存档 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);
        }
    }

我不知道如何查找/获取存档 ID。在 master.meta 索引文件中,我使用了以下 id,希望它是存档 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
      },

任何帮助都会挽救生命。谢谢你。

4

0 回答 0