“文档” 菜单
文档首页
/ /
Atlas
/ / / /

atlas serverless backups restores create

在此页面上

  • 语法
  • 选项
  • 继承选项
  • 举例

为您的无服务器实例启动恢复作业。

如果您创建自动或 pointInTime 恢复作业,Atlas 会在恢复之前删除目标集群上的所有现有数据。

要使用此命令,您必须使用具有项目所有者角色的用户帐户或 API 密钥进行身份验证。 Atlas 仅对 M10+ 集群支持此命令。

命令语法
atlas serverless backups restores create [options]
名称
类型
必需
说明
--clusterName
字符串
true
集群名称。 要了解详情,请参阅 https://dochub.mongodb.org/core/create-cluster-api。
--deliveryType
字符串
true
要创建的恢复作业的类型。有效值包括:automated、download、pointInTime。要了解有关恢复作业类型的更多信息,请参阅 https://dochub.mongodb.org/core/backup-restore-cluster-atlas。
-h,--help
false
创建帮助
--oplogInc
int
false
32 位递增序数,表示给定秒内的操作。 与 oplogTs 配对时,它们表示数据将恢复到的时间点。
--oplogTs
int
false
Oplog 时间戳,以自 UNIX 纪元以来经过的秒数表示的时间戳。 与 oplogInc 配合使用时,它们表示数据将恢复到的时间点。
-o, --output
字符串
false
输出格式。 有效值为 json、json-path、go-template 或 go-template-file。 要查看完整输出,请使用 -o json 选项。
--pointInTimeUTCSeconds
int
false
自 UNIX 纪元以来经过的时间戳(以秒为单位),表示数据将恢复到的时间点。 此时间戳必须在当前时间的最后 24 小时内。
--projectId
字符串
false
标识要使用的项目的十六进制字符串。 此选项会覆盖配置文件或环境变量中的设置。
--snapshotId
字符串
false
快照的唯一标识符。
--targetClusterName
字符串
false
目标集群的名称。 仅用于自动恢复作业。 您必须为自动恢复指定 targetClusterName。
--targetProjectId
字符串
false
包含恢复作业的目标集群的项目的唯一标识符。 您必须为自动恢复指定 targetProjectId。
名称
类型
必需
说明
-P, --profile
字符串
false
要从配置文件中使用的配置文件的名称。 要了解 Atlas CLI 的配置文件,请参阅 https://dochub.mongodb.org/core/atlas-cli-save-connection-settings。
# Create an automated restore:
atlas serverless backup restore create \
--deliveryType automated \
--clusterName myDemo \
--snapshotId 5e7e00128f8ce03996a47179 \
--targetClusterName myDemo2 \
--targetProjectId 1a2345b67c8e9a12f3456de7
# Create a point-in-time restore:
atlas serverless backup restore create \
--deliveryType pointInTime \
--clusterName myDemo \
--pointInTimeUTCSeconds 1588523147 \
--targetClusterName myDemo2 \
--targetProjectId 1a2345b67c8e9a12f3456de7
# Create a download restore:
atlas serverless backup restore create \
--deliveryType download \
--clusterName myDemo \
--snapshotId 5e7e00128f8ce03996a47179

后退

恢复

来年

描述