[英]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:进一步查看文档我找不到任何一个:
start-restore-job
or describe-restore-job
)start-restore-job
或describe-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
时间部分如何映射到还原作业的creationDate
和completionDate
,但它们似乎都不匹配( 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.