我正在尝试从S3 Glacier storag中检索一个zip文件夹。我想在存储区名称>备份> 2018年11月1日>里面的zip文件中,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
},
任何帮助都会挽救生命。谢谢。