简体   繁体   English

我能否以编程方式检索 EFS 恢复点恢复到的目录?

[英]Can I programatically retrieve the directory an EFS Recovery Point was restored to?

I'm trying to restore data in EFS from recovery points managed by AWS Backup.我正在尝试从 AWS Backup 管理的恢复点恢复 EFS 中的数据。 It seems AWS Backup does not support destructive restores and will always restore to a directory in the target EFS file system, even when creating a new one.似乎 AWS Backup 不支持破坏性恢复,并且将始终恢复到目标 EFS 文件系统中的目录,即使在创建新目录时也是如此。

I would like to sync the data extracted from such a recovery point to another volume, but right now I can only do this manually as I need to lookup the directory name that is used by the start-restore-job operation (eg aws-backup-restore_2022-05-16T11-01-17-599Z ), as stated in the docs:我想将从这样的恢复点提取的数据同步到另一个卷,但现在我只能手动执行此操作,因为我需要查找start-restore-job操作使用的目录名称(例如aws-backup-restore_2022-05-16T11-01-17-599Z ),如文档中所述:

You can restore those items to either a new or existing file system.您可以将这些项目恢复到新的或现有的文件系统。 Either way, AWS Backup creates a new Amazon EFS directory (aws-backup-restore_datetime) off of the root directory to contain the items.无论哪种方式,AWS Backup 都会从根目录创建一个新的 Amazon EFS 目录 (aws-backup-restore_datetime) 以包含项目。

Further looking through the documentation I can't find either of:进一步查看文档我找不到任何一个:

  • an option to set the name of the directory used设置所用目录名称的选项
  • the value of directory name returned in any call (either start-restore-job or describe-restore-job )任何调用中返回的目录名称的值( start-restore-jobdescribe-restore-job

I have also checked how the datetime portion of the directory name maps to the creationDate and completionDate of the restore job but it seems neither match ( completionDate is very close, but it's not the exact same timestamp).我还检查了目录名称的datetime时间部分如何映射到还原作业的creationDatecompletionDate ,但它们似乎都不匹配( completionDate非常接近,但它不是完全相同的时间戳)。

Is there any way for me to do one of these two things?我有什么办法可以做这两件事之一吗? Both of them missing make restoring a file system from a recovery point in an automated fashion very hard.它们都缺失使得以自动方式从恢复点恢复文件系统变得非常困难。

Is there any way for me to do one of these two things?我有什么办法可以做这两件事之一吗?

As it stands, no.就目前而言,没有。

However, since we know that the directory will always be in the root, doing find. -type d -name "aws-backup-restore_*"但是,因为我们知道该目录将始终位于根目录中,所以执行find. -type d -name "aws-backup-restore_*" find. -type d -name "aws-backup-restore_*" should return the directory name to you. find. -type d -name "aws-backup-restore_*"应将目录名称返回给您。 You could also further filter this down based on the year, month, day, hour & minute.您还可以根据年、月、日、小时和分钟进一步过滤。

You could have something polling the job status on the machine that has the EFS file system mounted, finding the correct directory and then pushing that to AWS Systems Manager Parameter Store for later retrieval.您可以在安装了 EFS 文件系统的机器上轮询作业状态,找到正确的目录,然后将其推送到 AWS Systems Manager Parameter Store 以供以后检索。 If restoring to a new file system, this of course becomes more difficult but still doable in an automated fashion.如果恢复到一个新的文件系统,这当然会变得更加困难,但仍然可以以自动化的方式进行。

If you're not mounting this on an EC2 instance, for example, running a Lambda with the EFS file system mounted, will let you obtain the directory & then push it to Parameter Store for retrieval elsewhere.如果您没有将其安装在 EC2 实例上,例如,在安装了 EFS 文件系统的情况下运行 Lambda,将让您获取目录,然后将其推送到 Parameter Store 以便在其他地方检索。 The Lambda service mounts EFS file systems when the execution environment is prepared - in other words, during the 'cold start' duration so there are no extra costs here for extra invocation time & as such, would be the cheapest option. Lambda 服务会在准备好执行环境时安装 EFS 文件系统- 换句话说,在“冷启动”期间,因此不会因额外的调用时间而产生额外费用,因此,这将是最便宜的选择。

There's no built-in way via the APIs however to obtain the directory or configure it so you're stuck there.但是,没有通过 API 的内置方法来获取目录或配置它,因此您被困在那里。

It's an AWS failure that neither do they return the filename that they use in any way nor does any of the metadata returned - creationDate / completionData - exactly match the timestamp they use to name the file.这是一个 AWS 失败,他们既没有返回他们以任何方式使用的文件名,也没有返回任何元数据 - creationDate / completionData - 与他们用来命名文件的时间戳完全匹配。

If you're an enterprise customer, suggest this as a missing feature to your TAM or SA.如果您是企业客户,建议将此作为您的 TAM 或 SA 缺少的功能。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将 EFS 添加到 Amazon-EKS 上的 Airflow 部署? - How can I add EFS to an Airflow deployment on Amazon-EKS? 需要使用 kube.netes pod 在 EFS 上创建目录 - Need to create the directory on EFS with kubernetes pod 我无法使用 Lambda 从 S3 下载文件到 EFS - I can't download file from S3 to EFS using Lambda 列出 EFS 中的根目录路径 - List out Root Directory path in EFS 如果表被删除,您可以使用时间点恢复来恢复 DynamoDB 表吗? - Can you restore a DynamoDB table using point in time recovery if it the table is deleted? EFS 策略条件 elasticfilesystem:AccessedViaMountTarget 何时为假? 可以在没有挂载目标的情况下访问 EFS 卷吗? - When is the EFS policy condition elasticfilesystem:AccessedViaMountTarget false? Can an EFS volume be accessed without a mount target? amazon-efs 失败,服务器给出的原因:没有这样的文件或目录 - amazon-efs failed, reason given by server: No such file or directory 我们可以在 AWS ECS docker 容器上挂载 EFS 吗? - Can we mount EFS on AWS ECS docker container? AWS DynamoDB Java SDK 如何查看表是否启用了时间点恢复 (PITR)? - AWS DynamoDB Java SDK how to see if Point-in-time recovery (PITR) is enabled on table? 我想将 EFS 挂载到 ECS,但在使用控制台为 EC2 集群创建 ECS 任务定义时没有 EFS 卷类型选项 - I want to mount EFS to ECS but I don't have EFS Volume Type option when creating ECS task definition for EC2-cluster using console
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM