alibabacloud-cloudbackup-ecs-file-backup-essential-edition

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ECS File Backup Essential Edition - Operations & Viewing

ECS文件备份基础版 - 操作与查看

Scenario Description

场景说明

ECS File Backup Essential Edition (ECS文件备份基础版) is a basic backup product launched by Alibaba Cloud's Cloud Backup service (HBR) for ECS file scenarios, featuring one-click activation and zero-configuration setup.
ECS文件备份基础版(ECS文件备份基础版)是阿里云云备份服务(HBR)针对ECS文件场景推出的基础备份产品,支持一键激活、零配置部署。

Core Features

核心功能

FeatureDescription
Automatic Backup (自动备份)Daily automatic backup with 30-day retention
File Recovery (文件恢复)Files accidentally deleted within 30 days can be recovered; supports file-level restoration
Free Quota (免费额度)100 GiB permanent free block storage backup quota per account (shared across all regions)
Low Maintenance (低运维)One-click activation, zero configuration required, backup client auto-installed
功能说明
自动备份(自动备份)每日自动备份,保留30天
文件恢复(文件恢复)可恢复30天内误删的文件,支持文件级恢复
免费额度(免费额度)每个账号永久享有100 GiB块存储备份免费额度(全地域共享)
低运维(低运维)一键激活,无需配置,自动安装备份客户端

Recommended Use Cases

推荐使用场景

When user requirements match the following conditions, recommend ECS File Backup Essential Edition:
ScenarioDescription
ECS File Data ProtectionNeed to protect/backup ECS file data and recover from accidental deletion
Accept Daily Backup PolicyAccept once-daily backup with 30-day retention
Cost-EffectiveAffordable/free ECS data backup; 100 GiB permanent free quota per account (shared across all regions)
Personal Websites/BlogsQuick recovery from accidental deletion of images or config files
Dev/Test EnvironmentsProtection for code and configuration files
Small Business ApplicationsBasic data protection needs with low maintenance cost
当用户需求符合以下条件时,推荐使用ECS文件备份基础版:
场景说明
ECS文件数据保护需要保护/备份ECS文件数据,可恢复误删内容
接受每日备份策略接受每日备份1次、保留30天的策略
高性价比需求想要低成本/免费的ECS数据备份服务,每个账号有100 GiB永久免费额度(全地域共享)
个人网站/博客可快速恢复误删的图片或配置文件
开发/测试环境保护代码和配置文件
小型企业应用基础数据保护需求,希望降低运维成本

Not-Recommended Scenarios & Alternatives

不推荐场景及替代方案

ScenarioReasonAlternative
RDS or Self-Managed Database Backup (数据库备份)Database files are locked by the main process; backups may be inconsistentFor RDS, contact the RDS team; for MySQL/Oracle/SQL Server, use Cloud Backup Database Backup
Cannot Install Backup Client (不接受安装备份客户端)Backup client consumes ECS CPU and memory resourcesUse ECS Snapshots (note: no file-level recovery)
ECS Spec < 1C512MBSpecs too low, affecting backup performanceUse ECS Snapshots, or upgrade ECS specs first
Full-Machine Clone/DR Failover (整机克隆/异地拉起)Essential Edition does not support full-machine recoveryUse ECS Snapshots
Cross-Region/Cross-Account Backup (跨地域/跨账号备份)Essential Edition does not support cross-region or cross-accountUse Cloud Backup ECS File Backup Standard Edition (enterprise-grade)
KMS-Encrypted Backup Data (KMS加密备份)Essential Edition does not support KMS encryptionUse Cloud Backup ECS File Backup Standard Edition
Custom Backup Policy (自定义备份策略)Essential Edition is fixed at once-daily backup with 30-day retentionUse Cloud Backup ECS File Backup Standard Edition (customizable policy)
Data Volume > 2 TBBackup may not complete within 24 hoursContact Cloud Backup technical support, or use Standard Edition
场景原因替代方案
RDS或自建数据库备份(数据库备份)数据库文件被主进程锁定,备份可能出现不一致RDS请联系RDS团队;MySQL/Oracle/SQL Server请使用云备份数据库备份
无法安装备份客户端(不接受安装备份客户端)备份客户端会占用ECS CPU和内存资源使用ECS快照(注意:不支持文件级恢复)
ECS规格 < 1C512MB规格过低,会影响备份性能使用ECS快照,或先升级ECS规格
整机克隆/灾备拉起(整机克隆/异地拉起)基础版不支持整机恢复使用ECS快照
跨地域/跨账号备份(跨地域/跨账号备份)基础版不支持跨地域或跨账号备份使用云备份ECS文件备份标准版(企业级)
KMS加密备份数据(KMS加密备份)基础版不支持KMS加密使用云备份ECS文件备份标准版
自定义备份策略(自定义备份策略)基础版固定为每日备份1次、保留30天使用云备份ECS文件备份标准版(支持自定义策略)
数据量 > 2 TB备份可能无法在24小时内完成联系云备份技术支持,或使用标准版

Usage Limitations

使用限制

LimitationDescription
Operating System32-bit operating systems not supported
Network TypeClassic network (经典网络) ECS not supported
Storage TypeOnly block storage (块存储) supported; NAS/OSS and other network-mounted storage not supported
Dependent ServiceRequires Cloud Assistant (云助手) service (ECS purchased before Dec 2017 requires manual installation of Cloud Assistant Agent)
ECS SpecRecommended >= 1 vCPU, 512 MB memory for adequate backup performance
Data VolumeLow priority: < 600 GB; High priority: < 2 TB

限制项说明
操作系统不支持32位操作系统
网络类型不支持经典网络(经典网络)ECS
存储类型仅支持块存储(块存储),不支持NAS/OSS等网络挂载存储
依赖服务需要云助手(云助手)服务(2017年12月之前购买的ECS需要手动安装Cloud Assistant Agent)
ECS规格推荐 >= 1 vCPU、512 MB内存,以保证备份性能
数据量低优先级:< 600 GB;高优先级:< 2 TB

Scenario Eligibility Check (Mandatory First Step)

场景适配性检查(强制第一步)

CRITICAL - Hard Gate: This is the first step before all operations, taking priority over installation checks, credential verification, and any workflow. The agent MUST complete this check before executing any other step.
Decision Flow:
User requests ECS backup/restore
|
+-> Check each item in "Not-Recommended Scenarios & Alternatives"
|   +-> Matches any not-recommended scenario -> Execute [HALT Flow]
|   +-> No match -> Pass, continue to "Installation Requirements"
|
+-> Not-recommended scenario keywords:
    - Database: MySQL/Oracle/SQL Server/PostgreSQL/MongoDB/Redis/database data directory
    - Full-machine: full-machine recovery/DR failover/clone instance
    - Cross-region/cross-account: remote backup/cross-account replication
    - Custom policy: hourly backup/custom retention period
    - Large data volume: data exceeds 2 TB
[HALT Flow] - Must execute when a not-recommended scenario is matched:
  1. Stop immediately - Do NOT execute installation checks, credential verification, parameter confirmation, or any CLI command
  2. Output warning to user - Explain why the current scenario is not suitable for ECS File Backup Essential Edition (cite the reason from "Not-Recommended Scenarios & Alternatives")
  3. Recommend alternatives - Provide specific alternative products/features
  4. End current task - After outputting the warning and alternatives, the agent MUST stop and NOT continue with any subsequent steps of this Skill
Sole recovery condition: Only when the user, after receiving the warning, proactively and explicitly states "I understand the risks and still want to use ECS File Backup Essential Edition" (or semantically equivalent explicit confirmation), may the agent continue with subsequent steps. The following are NOT considered valid confirmations; the agent must remain stopped:
  • User does not reply
  • User only replies with vague confirmations like "OK", "Continue", "Help me backup" without mentioning "ECS File Backup Essential Edition"
  • User changes the topic
  • User asks for details about alternatives (indicates user is considering alternatives; do not force continuation)

关键 - 硬门槛:这是所有操作前的第一步,优先级高于安装检查、凭证校验和任何工作流。 Agent执行其他任何步骤前必须先完成该检查。
决策流程:
用户请求ECS备份/恢复
|
+-> 检查「不推荐场景及替代方案」中的每一项
|   +-> 匹配任意不推荐场景 -> 执行[终止流程]
|   +-> 无匹配 -> 校验通过,继续执行「安装要求」
|
+-> 不推荐场景关键词:
    - 数据库:MySQL/Oracle/SQL Server/PostgreSQL/MongoDB/Redis/数据库数据目录
    - 整机:整机恢复/灾备拉起/实例克隆
    - 跨地域/跨账号:远程备份/跨账号复制
    - 自定义策略:每小时备份/自定义保留周期
    - 大数据量:数据超过2 TB
[终止流程] - 匹配到不推荐场景时必须执行:
  1. 立即停止操作 - 不要执行安装检查、凭证校验、参数确认或任何CLI命令
  2. 向用户输出警告 - 说明当前场景不适合使用ECS文件备份基础版的原因(引用「不推荐场景及替代方案」中的原因)
  3. 推荐替代方案 - 提供具体的替代产品/功能
  4. 结束当前任务 - 输出警告和替代方案后,Agent必须停止操作,不得继续执行该Skill的任何后续步骤。
唯一恢复条件:只有当用户收到警告后,主动明确表示「我了解风险,仍要使用ECS文件备份基础版」(或语义等价的明确确认),Agent才可以继续执行后续步骤。 以下情况视为有效确认,Agent必须保持终止状态:
  • 用户无回复
  • 用户仅回复「好的」「继续」「帮我备份」等模糊确认,未提及「ECS文件备份基础版」
  • 用户转移话题
  • 用户询问替代方案的详情(表示用户正在考虑替代方案,不要强制继续)

Installation Requirements (Mandatory Pre-check)

安装要求(强制前置检查)

CRITICAL: The agent MUST complete the following pre-checks before executing any core workflow.
关键:Agent执行任何核心工作流前必须完成以下前置检查。

Pre-check: Aliyun CLI >= 3.3.1 required

前置检查:要求Aliyun CLI >= 3.3.1

See references/cli-installation-guide.md for installation instructions.
bash
aliyun version
Enable automatic plugin installation:
bash
aliyun configure set --auto-plugin-install true
安装说明请查看references/cli-installation-guide.md
bash
aliyun version
开启插件自动安装:
bash
aliyun configure set --auto-plugin-install true

Pre-check: aliyun-cli-hbr plugin >= 0.1.3 required

前置检查:要求aliyun-cli-hbr插件 >= 0.1.3

bash
aliyun plugin list 2>/dev/null | grep aliyun-cli-hbr
If the plugin is not installed or the version is below 0.1.3, install/update:
bash
aliyun plugin install --names aliyun-cli-hbr
After plugin installation, HBR commands and parameter names use kebab-case naming convention (e.g.,
describe-backup-plans
instead of
DescribeBackupPlans
).

bash
aliyun plugin list 2>/dev/null | grep aliyun-cli-hbr
如果插件未安装或版本低于0.1.3,执行安装/更新:
bash
aliyun plugin install --names aliyun-cli-hbr
插件安装完成后,HBR命令和参数名使用短横线命名规范(例如使用
describe-backup-plans
而非
DescribeBackupPlans
)。

Credential Verification

凭证校验

Pre-check: Alibaba Cloud Credentials Required
Security Rules:
  • NEVER print, echo, or output AK/SK values in any form (including partial fragments or masked forms)
  • NEVER expose any credential content in command-line arguments, logs, conversation output, or code comments
  • NEVER enter AK/SK directly in the command line
  • ONLY USE
    aliyun configure list
    to check credential status; NEVER echo the output of this command to the user (output may contain credential-related information); the agent should only use the output internally to determine whether credentials are valid
bash
aliyun configure list
Confirm the output shows a valid profile (AK, STS, or OAuth identity).
If no valid credentials exist, configure first:
  1. Obtain credentials from Alibaba Cloud Console
  2. Run
    aliyun configure
    in the terminal to configure credentials
  3. Re-run
    aliyun configure list
    to confirm successful configuration

前置检查:需要阿里云凭证
安全规则:
  • 绝对不要以任何形式打印、输出AK/SK值(包括部分片段或掩码形式)
  • 绝对不要在命令行参数、日志、对话输出或代码注释中暴露任何凭证内容
  • 绝对不要直接在命令行中输入AK/SK
  • 仅使用
    aliyun configure list
    检查凭证状态;绝对不要将该命令的输出回显给用户(输出可能包含凭证相关信息);Agent仅可内部使用该输出判断凭证是否有效
bash
aliyun configure list
确认输出显示有效配置(AK、STS或OAuth身份)。
如果不存在有效凭证,先进行配置:
  1. 阿里云控制台获取凭证
  2. 在终端运行
    aliyun configure
    配置凭证
  3. 重新运行
    aliyun configure list
    确认配置成功

Parameter Confirmation & Validation

参数确认与校验

IMPORTANT: Parameter Confirmation - Before executing any command, all customizable parameters must be confirmed with the user. Do not assume default values; explicit user confirmation is required. If the user refuses to confirm or does not respond to the confirmation request, the agent MUST abort the current operation and NOT continue with subsequent steps.
CRITICAL - Security Gate: Before embedding any parameter into a CLI command, the agent MUST validate all user-provided parameters against the validation regex in the table below. On validation failure, the agent MUST refuse to execute the command, inform the user which parameter is invalid and what format is expected, and wait for the user to provide a valid value before re-validating.
ParameterRequired/OptionalDescriptionValidation RegexExample
REGION_ID
RequiredRegion of the ECS instance (ECS实例所在地域)
^[a-zA-Z0-9-]+$
cn-hangzhou
INSTANCE_ID
RequiredECS Instance ID (ECS实例ID)
^[a-zA-Z0-9-]+$
i-bp1abc123def456
PLAN_ID
Required for some opsBackup Plan ID (备份计划ID); needed for pause/resume/cancel
^[a-zA-Z0-9-]+$
plan-abc123
VAULT_ID
Required for restoreBackup Vault ID (备份仓库ID); obtained via
search-historical-snapshots
^[a-zA-Z0-9-]+$
v-0001xjb123
SNAPSHOT_ID
Required for restoreSnapshot ID (备份版本ID); obtained via
search-historical-snapshots
^[a-zA-Z0-9-]+$
s-0001abc123
SNAPSHOT_HASH
Required for restoreSnapshot Hash (备份版本哈希值); obtained via
search-historical-snapshots
^[a-zA-Z0-9-]+$
sh-abc123
performanceLevel
OptionalBackup priority (备份优先级):
L0
(default, data < 600 GB) or
L1
(data 600 GB~2 TB)
^(L0|L1)$
L0
ConflictPolicy
Required for restoreFile conflict policy (文件冲突策略):
SKIP_THE_FILE
(skip) or
OVERWRITE_EXISTING
(overwrite)
^(SKIP_THE_FILE|OVERWRITE_EXISTING)$
SKIP_THE_FILE
CLIENT_TOKEN
Required for restoreIdempotency token (幂等令牌); agent-generated UUID, reuse on timeout retry
^[a-zA-Z0-9-]{1,64}$
550e8400-e29b-41d4-a716-446655440000
keep-latest-snapshots
OptionalKeep last backup version (保留最后一个备份版本):
1
(keep) or
0
(don't keep)
^(0|1)$
1
SOURCE_PATH
Optional for restoreSource file path to restore (要恢复的源文件路径)
^[a-zA-Z0-9/_.-]+$
/home/data/file.txt
TARGET_PATH
Required for restoreRestore target directory (恢复目标目录); must already exist
^[a-zA-Z0-9/_.-]+$
/tmp/restore
重要:参数确认 - 执行任何命令前,所有可自定义参数必须和用户确认。 不要假设默认值,必须获得用户明确确认。 如果用户拒绝确认或未响应确认请求,Agent必须终止当前操作,不得继续执行后续步骤。
关键 - 安全门槛:将任何参数嵌入CLI命令前,Agent必须对照下表中的校验正则验证所有用户提供的参数。 校验失败时,Agent必须拒绝执行命令,告知用户哪个参数无效、预期格式是什么,等待用户提供有效值后重新校验。
参数必填/可选说明校验正则示例
REGION_ID
必填ECS实例所在地域(ECS实例所在地域)
^[a-zA-Z0-9-]+$
cn-hangzhou
INSTANCE_ID
必填ECS实例ID(ECS实例ID)
^[a-zA-Z0-9-]+$
i-bp1abc123def456
PLAN_ID
部分操作必填备份计划ID(备份计划ID),暂停/恢复/取消操作需要
^[a-zA-Z0-9-]+$
plan-abc123
VAULT_ID
恢复操作必填备份仓库ID(备份仓库ID),可通过
search-historical-snapshots
获取
^[a-zA-Z0-9-]+$
v-0001xjb123
SNAPSHOT_ID
恢复操作必填备份版本ID(备份版本ID),可通过
search-historical-snapshots
获取
^[a-zA-Z0-9-]+$
s-0001abc123
SNAPSHOT_HASH
恢复操作必填备份版本哈希值(备份版本哈希值),可通过
search-historical-snapshots
获取
^[a-zA-Z0-9-]+$
sh-abc123
performanceLevel
可选备份优先级(备份优先级):
L0
(默认,数据<600 GB)或
L1
(数据600 GB~2 TB)
^(L0|L1)$
L0
ConflictPolicy
恢复操作必填文件冲突策略(文件冲突策略):
SKIP_THE_FILE
(跳过)或
OVERWRITE_EXISTING
(覆盖)
^(SKIP_THE_FILE|OVERWRITE_EXISTING)$
SKIP_THE_FILE
CLIENT_TOKEN
恢复操作必填幂等令牌(幂等令牌),Agent生成的UUID,超时重试时复用
^[a-zA-Z0-9-]{1,64}$
550e8400-e29b-41d4-a716-446655440000
keep-latest-snapshots
可选保留最后一个备份版本(保留最后一个备份版本):
1
(保留)或
0
(不保留)
^(0|1)$
1
SOURCE_PATH
恢复操作可选要恢复的源文件路径(要恢复的源文件路径)
^[a-zA-Z0-9/_.-]+$
/home/data/file.txt
TARGET_PATH
恢复操作必填恢复目标目录(恢复目标目录),必须已存在
^[a-zA-Z0-9/_.-]+$
/tmp/restore

RAM Permissions

RAM权限

This Skill requires the permissions detailed in references/ram-policies.md.
Recommended system policy:
AliyunHBRFullAccess

该Skill需要的权限详情请查看references/ram-policies.md
推荐系统策略:
AliyunHBRFullAccess

Core Workflows

核心工作流

CRITICAL: Before executing any of the following workflows, the agent MUST complete all steps in "Scenario Eligibility Check" and "Installation Requirements (Mandatory Pre-check)". If Aliyun CLI or the aliyun-cli-hbr plugin is not installed or does not meet version requirements, it MUST be installed/updated first before proceeding.
关键:执行以下任何工作流前,Agent必须完成「场景适配性检查」和「安装要求(强制前置检查)」的所有步骤。 如果Aliyun CLI或aliyun-cli-hbr插件未安装或版本不符合要求,必须先安装/更新再继续操作。

1. Activate Backup

1. 激活备份

Activate ECS File Backup Essential Edition for a specified ECS instance.
Step 1: Enable Cloud Backup Service (first-time use)
bash
aliyun hbr open-hbr-service \
  --endpoint hbr.aliyuncs.com \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
Idempotent operation; safe to run repeatedly.
Step 2: Activate ECS Instance Backup
bash
aliyun hbr create-backup-plan \
  --region <REGION_ID> \
  --edition BASIC \
  --source-type ECS_FILE \
  --instance-id <INSTANCE_ID> \
  --keep-latest-snapshots 1 \
  --options '{"performanceLevel":"<LEVEL>"}' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
Idempotent operation; repeated calls for the same instance will not create duplicate backup plans. Safe to retry on timeout.
Step 3: Verify Activation Status
Activation and client installation are asynchronous operations; they typically take a few minutes to become ready.
Use the status determination logic from "5. View ECS Backup Status" to verify. Expected state progression:
Preparing
->
Ready
->
Backing Up

为指定ECS实例激活ECS文件备份基础版。
步骤1:开通云备份服务(首次使用)
bash
aliyun hbr open-hbr-service \
  --endpoint hbr.aliyuncs.com \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
幂等操作,重复执行安全。
步骤2:激活ECS实例备份
bash
aliyun hbr create-backup-plan \
  --region <REGION_ID> \
  --edition BASIC \
  --source-type ECS_FILE \
  --instance-id <INSTANCE_ID> \
  --keep-latest-snapshots 1 \
  --options '{"performanceLevel":"<LEVEL>"}' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
幂等操作,同一实例重复调用不会创建重复备份计划,超时重试安全。
步骤3:验证激活状态
激活和客户端安装是异步操作,通常需要几分钟时间就绪。
使用「5. 查看ECS备份状态」中的状态判定逻辑进行验证。预期状态流转:
准备中
->
就绪
->
备份中

2. Pause Backup (Suspend)

2. 暂停备份

Pause the backup plan (备份计划) while retaining existing backup data; can be resumed later.
Step 1: Get Backup Plan ID
bash
aliyun hbr describe-backup-plans \
  --region <REGION_ID> \
  --edition BASIC \
  --source-type ECS_FILE \
  --filters '[{"Key":"instanceId","Values":["<INSTANCE_ID>"]}]' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
Extract
PlanId
from the response.
Step 2: Pause Backup
bash
aliyun hbr disable-backup-plan \
  --region <REGION_ID> \
  --plan-id <PLAN_ID> \
  --edition BASIC \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
Idempotent operation; safe to call repeatedly.

暂停备份计划(备份计划),保留现有备份数据,后续可恢复。
步骤1:获取备份计划ID
bash
aliyun hbr describe-backup-plans \
  --region <REGION_ID> \
  --edition BASIC \
  --source-type ECS_FILE \
  --filters '[{"Key":"instanceId","Values":["<INSTANCE_ID>"]}]' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
从响应中提取
PlanId
步骤2:暂停备份
bash
aliyun hbr disable-backup-plan \
  --region <REGION_ID> \
  --plan-id <PLAN_ID> \
  --edition BASIC \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
幂等操作,重复调用安全。

3. Resume Backup

3. 恢复备份

Resume a previously paused backup plan.
bash
aliyun hbr enable-backup-plan \
  --region <REGION_ID> \
  --plan-id <PLAN_ID> \
  --edition BASIC \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
Idempotent operation; safe to call repeatedly.

恢复之前暂停的备份计划。
bash
aliyun hbr enable-backup-plan \
  --region <REGION_ID> \
  --plan-id <PLAN_ID> \
  --edition BASIC \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
幂等操作,重复调用安全。

4. Cancel Backup (Delete)

4. 取消备份(删除)

WARNING: This operation will permanently delete all backup data and is irreversible! User intent must be confirmed before execution. If the user has not explicitly confirmed deletion, the agent MUST abort the operation and NOT continue.
Step 1: Get Backup Plan ID
bash
aliyun hbr describe-backup-plans \
  --region <REGION_ID> \
  --source-type ECS_FILE \
  --edition BASIC \
  --filters '[{"Key":"instanceId","Values":["<INSTANCE_ID>"]}]' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
Step 2: Delete Backup Plan
bash
aliyun hbr delete-backup-plan \
  --region <REGION_ID> \
  --plan-id <PLAN_ID> \
  --edition BASIC \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
After cancellation, the instance stops incurring charges; deleted backup data cannot be recovered. Idempotent operation; safe to call repeatedly on an already-deleted plan.

警告:该操作会永久删除所有备份数据,不可撤销!执行前必须确认用户意图。 如果用户未明确确认删除,Agent必须终止操作,不得继续。
步骤1:获取备份计划ID
bash
aliyun hbr describe-backup-plans \
  --region <REGION_ID> \
  --source-type ECS_FILE \
  --edition BASIC \
  --filters '[{"Key":"instanceId","Values":["<INSTANCE_ID>"]}]' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
步骤2:删除备份计划
bash
aliyun hbr delete-backup-plan \
  --region <REGION_ID> \
  --plan-id <PLAN_ID> \
  --edition BASIC \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
取消后实例不再产生费用,已删除的备份数据无法恢复。 幂等操作,对已删除的计划重复调用安全。

5. View ECS Backup Status

5. 查看ECS备份状态

Step 1: Query Backup Plan
bash
aliyun hbr describe-backup-plans \
  --region <REGION_ID> \
  --edition BASIC \
  --source-type ECS_FILE \
  --filters '[{"Key":"instanceId","Values":["<INSTANCE_ID>"]}]' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
Step 2: Query Latest Backup Job
bash
aliyun hbr describe-backup-jobs-2 \
  --region <REGION_ID> \
  --edition BASIC \
  --source-type ECS_FILE \
  --filters '[{"Key":"instanceId","Values":["<INSTANCE_ID>"]}]' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
describe-backup-jobs-2
returns backup jobs sorted by creation time in descending order; the first record is the latest execution result.
Status Determination Logic
describe-backup-plans finds no plan -> Not Activated (未激活)
describe-backup-plans finds a plan
+-> Disabled = true -> Paused (已暂停)
+-> Query describe-backup-jobs-2 for latest backup job
    +-> No backup jobs -> Preparing (准备中)
    +-> Has backup jobs (first record = latest result)
        +-> COMPLETE/PARTIAL_COMPLETE -> Backup Normal (备份正常)
        +-> RUNNING/QUEUED/CREATED -> Backing Up (备份中)
        +-> CANCELED -> Canceled (已取消)
        +-> FAILED/EXPIRED -> Backup Abnormal (备份异常); troubleshoot via describe-backup-clients
Auxiliary Query Commands
View backup client status:
bash
aliyun hbr describe-backup-clients \
  --region <REGION_ID> \
  --client-type ECS_CLIENT \
  --instance-ids '["<INSTANCE_ID>"]' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
View backup history (Snapshot list):
bash
aliyun hbr search-historical-snapshots \
  --region <REGION_ID> \
  --edition BASIC \
  --source-type ECS_FILE \
  --query '[{"field":"instanceId","value":"<INSTANCE_ID>","operation":"MATCH_TERM"}]' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills

步骤1:查询备份计划
bash
aliyun hbr describe-backup-plans \
  --region <REGION_ID> \
  --edition BASIC \
  --source-type ECS_FILE \
  --filters '[{"Key":"instanceId","Values":["<INSTANCE_ID>"]}]' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
步骤2:查询最新备份任务
bash
aliyun hbr describe-backup-jobs-2 \
  --region <REGION_ID> \
  --edition BASIC \
  --source-type ECS_FILE \
  --filters '[{"Key":"instanceId","Values":["<INSTANCE_ID>"]}]' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
describe-backup-jobs-2
返回按创建时间降序排列的备份任务,第一条记录为最新执行结果。
状态判定逻辑
describe-backup-plans未查询到计划 -> 未激活(未激活)
describe-backup-plans查询到计划
+-> Disabled = true -> 已暂停(已暂停)
+-> 调用describe-backup-jobs-2查询最新备份任务
    +-> 无备份任务 -> 准备中(准备中)
    +-> 存在备份任务(第一条记录=最新结果)
        +-> COMPLETE/PARTIAL_COMPLETE -> 备份正常(备份正常)
        +-> RUNNING/QUEUED/CREATED -> 备份中(备份中)
        +-> CANCELED -> 已取消(已取消)
        +-> FAILED/EXPIRED -> 备份异常(备份异常);通过describe-backup-clients排查问题
辅助查询命令
查看备份客户端状态:
bash
aliyun hbr describe-backup-clients \
  --region <REGION_ID> \
  --client-type ECS_CLIENT \
  --instance-ids '["<INSTANCE_ID>"]' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
查看备份历史(快照列表):
bash
aliyun hbr search-historical-snapshots \
  --region <REGION_ID> \
  --edition BASIC \
  --source-type ECS_FILE \
  --query '[{"field":"instanceId","value":"<INSTANCE_ID>","operation":"MATCH_TERM"}]' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills

6. View Free Quota & Capacity

6. 查看免费额度与容量

bash
aliyun hbr get-basic-statistics \
  --source-type ECS_FILE \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
Key field:
GlobalStatistics.ProtectedDataSize
is the total block storage capacity of backed-up ECS instances (in bytes).
Free quota rules: 100 GiB per account (permanent, shared across all regions). Usage beyond the quota is billed on a pay-as-you-go basis; billing is based on the total block storage capacity mounted on backed-up ECS instances.

bash
aliyun hbr get-basic-statistics \
  --source-type ECS_FILE \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
关键字段
GlobalStatistics.ProtectedDataSize
为已备份ECS实例的块存储总容量(单位:字节)。
免费额度规则:每个账号100 GiB(永久有效,全地域共享)。超出额度的部分按按量付费计费,计费基数为已备份ECS实例挂载的块存储总容量。

7. File Restore

7. 文件恢复

bash
aliyun hbr create-restore-job \
  --region <REGION_ID> \
  --restore-type ECS_FILE \
  --edition BASIC \
  --source-type ECS_FILE \
  --vault-id <VAULT_ID> \
  --snapshot-id <SNAPSHOT_ID> \
  --snapshot-hash <SNAPSHOT_HASH> \
  --include '["<SOURCE_PATH>"]' \
  --target-instance-id <INSTANCE_ID> \
  --target-path <TARGET_PATH> \
  --options '{"ConflictPolicy":"<CONFLICT_POLICY>"}' \
  --client-token <UUID> \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
VaultId
,
SnapshotId
, and
SnapshotHash
can be obtained via
search-historical-snapshots
. Omitting
--include
restores all files in the snapshot.
TargetPath
must be an existing directory on the target ECS instance; otherwise the restore job will report a
TARGET_NOT_EXIST
error. Using the
OVERWRITE_EXISTING
policy will overwrite files with the same name at the target path; explicit user confirmation is required before execution. If the user has not confirmed, the agent MUST abort the restore operation. Use
--client-token
to ensure idempotency; the agent should generate a UUID as the ClientToken and reuse the same token on timeout retries to prevent duplicate restore jobs.
View Restore Progress
bash
aliyun hbr describe-restore-jobs-2 \
  --region <REGION_ID> \
  --edition BASIC \
  --restore-type ECS_FILE \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills

bash
aliyun hbr create-restore-job \
  --region <REGION_ID> \
  --restore-type ECS_FILE \
  --edition BASIC \
  --source-type ECS_FILE \
  --vault-id <VAULT_ID> \
  --snapshot-id <SNAPSHOT_ID> \
  --snapshot-hash <SNAPSHOT_HASH> \
  --include '["<SOURCE_PATH>"]' \
  --target-instance-id <INSTANCE_ID> \
  --target-path <TARGET_PATH> \
  --options '{"ConflictPolicy":"<CONFLICT_POLICY>"}' \
  --client-token <UUID> \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
VaultId
SnapshotId
SnapshotHash
可通过
search-historical-snapshots
获取。 省略
--include
会恢复快照中的所有文件。
TargetPath
必须是目标ECS实例上已存在的目录,否则恢复任务会报
TARGET_NOT_EXIST
错误。 使用
OVERWRITE_EXISTING
策略会覆盖目标路径下的同名文件,执行前必须获得用户明确确认。如果用户未确认,Agent必须终止恢复操作。 使用
--client-token
保证幂等性,Agent应生成UUID作为ClientToken,超时重试时复用相同令牌,避免重复创建恢复任务。
查看恢复进度
bash
aliyun hbr describe-restore-jobs-2 \
  --region <REGION_ID> \
  --edition BASIC \
  --restore-type ECS_FILE \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills

8. Modify Scheduled Backup Time

8. 修改定时备份时间

Step 1: Get Backup Plan ID
bash
aliyun hbr describe-backup-plans \
  --region <REGION_ID> \
  --edition BASIC \
  --source-type ECS_FILE \
  --filters '[{"Key":"instanceId","Values":["<INSTANCE_ID>"]}]' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
Step 2: Update Backup Schedule
bash
aliyun hbr update-backup-plan \
  --region <REGION_ID> \
  --plan-id <PLAN_ID> \
  --edition BASIC \
  --schedule 'I|<TIMESTAMP>|P1D' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
Schedule format:
I|<start_timestamp>|P1D
, where start_timestamp is a Unix timestamp in seconds, and
P1D
means once per day (fixed for Essential Edition). Idempotent operation; safe to call repeatedly.

步骤1:获取备份计划ID
bash
aliyun hbr describe-backup-plans \
  --region <REGION_ID> \
  --edition BASIC \
  --source-type ECS_FILE \
  --filters '[{"Key":"instanceId","Values":["<INSTANCE_ID>"]}]' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
步骤2:更新备份调度
bash
aliyun hbr update-backup-plan \
  --region <REGION_ID> \
  --plan-id <PLAN_ID> \
  --edition BASIC \
  --schedule 'I|<TIMESTAMP>|P1D' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
调度格式:
I|<start_timestamp>|P1D
,其中start_timestamp是秒级Unix时间戳,
P1D
表示每天1次(基础版固定)。 幂等操作,重复调用安全。

9. Toggle Keep-Last-Snapshot

9. 切换保留最近快照开关

When enabled, even if all backup versions exceed the retention period, the system will retain the last version without deleting it.
bash
aliyun hbr update-backup-plan \
  --region <REGION_ID> \
  --plan-id <PLAN_ID> \
  --edition BASIC \
  --keep-latest-snapshots <0_OR_1> \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
1
= keep the last backup version (recommended);
0
= do not keep; all backup points older than 30 days will be automatically deleted. Idempotent operation; safe to call repeatedly.

开启后,即使所有备份版本超出保留周期,系统也会保留最后一个版本不删除。
bash
aliyun hbr update-backup-plan \
  --region <REGION_ID> \
  --plan-id <PLAN_ID> \
  --edition BASIC \
  --keep-latest-snapshots <0_OR_1> \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
1
= 保留最后一个备份版本(推荐);
0
= 不保留,超过30天的所有备份点会自动删除。 幂等操作,重复调用安全。

10. Adjust Backup Execution Priority

10. 调整备份执行优先级

bash
aliyun hbr update-backup-plan \
  --region <REGION_ID> \
  --plan-id <PLAN_ID> \
  --edition BASIC \
  --options '{"performanceLevel":"<LEVEL>"}' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
See
performanceLevel
in the Parameter Confirmation table for valid values; detailed use cases are described in references/related-apis.md. Idempotent operation; safe to call repeatedly.

bash
aliyun hbr update-backup-plan \
  --region <REGION_ID> \
  --plan-id <PLAN_ID> \
  --edition BASIC \
  --options '{"performanceLevel":"<LEVEL>"}' \
  --read-timeout 60 \
  --user-agent AlibabaCloud-Agent-Skills
有效值请参考参数确认表中的
performanceLevel
说明,详细使用场景请查看references/related-apis.md。 幂等操作,重复调用安全。

Verification

验证

See references/verification-method.md for details.

详情请查看references/verification-method.md

References

参考文档

DocumentLink
CLI Installation Guidereferences/cli-installation-guide.md
API & CLI Command Referencereferences/related-apis.md
RAM Permission Policiesreferences/ram-policies.md
Verification Methodsreferences/verification-method.md
Official User GuideECS File Backup Essential Edition
Cloud Backup API DocsHBR API Reference
文档链接
CLI安装指南references/cli-installation-guide.md
API与CLI命令参考references/related-apis.md
RAM权限策略references/ram-policies.md
验证方法references/verification-method.md
官方用户指南ECS文件备份基础版
云备份API文档HBR API参考