alibabacloud-cloudbackup-ecs-file-backup-essential-edition
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseECS 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
核心功能
| Feature | Description |
|---|---|
| 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:
| Scenario | Description |
|---|---|
| ECS File Data Protection | Need to protect/backup ECS file data and recover from accidental deletion |
| Accept Daily Backup Policy | Accept once-daily backup with 30-day retention |
| Cost-Effective | Affordable/free ECS data backup; 100 GiB permanent free quota per account (shared across all regions) |
| Personal Websites/Blogs | Quick recovery from accidental deletion of images or config files |
| Dev/Test Environments | Protection for code and configuration files |
| Small Business Applications | Basic data protection needs with low maintenance cost |
当用户需求符合以下条件时,推荐使用ECS文件备份基础版:
| 场景 | 说明 |
|---|---|
| ECS文件数据保护 | 需要保护/备份ECS文件数据,可恢复误删内容 |
| 接受每日备份策略 | 接受每日备份1次、保留30天的策略 |
| 高性价比需求 | 想要低成本/免费的ECS数据备份服务,每个账号有100 GiB永久免费额度(全地域共享) |
| 个人网站/博客 | 可快速恢复误删的图片或配置文件 |
| 开发/测试环境 | 保护代码和配置文件 |
| 小型企业应用 | 基础数据保护需求,希望降低运维成本 |
Not-Recommended Scenarios & Alternatives
不推荐场景及替代方案
| Scenario | Reason | Alternative |
|---|---|---|
| RDS or Self-Managed Database Backup (数据库备份) | Database files are locked by the main process; backups may be inconsistent | For 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 resources | Use ECS Snapshots (note: no file-level recovery) |
| ECS Spec < 1C512MB | Specs too low, affecting backup performance | Use ECS Snapshots, or upgrade ECS specs first |
| Full-Machine Clone/DR Failover (整机克隆/异地拉起) | Essential Edition does not support full-machine recovery | Use ECS Snapshots |
| Cross-Region/Cross-Account Backup (跨地域/跨账号备份) | Essential Edition does not support cross-region or cross-account | Use Cloud Backup ECS File Backup Standard Edition (enterprise-grade) |
| KMS-Encrypted Backup Data (KMS加密备份) | Essential Edition does not support KMS encryption | Use Cloud Backup ECS File Backup Standard Edition |
| Custom Backup Policy (自定义备份策略) | Essential Edition is fixed at once-daily backup with 30-day retention | Use Cloud Backup ECS File Backup Standard Edition (customizable policy) |
| Data Volume > 2 TB | Backup may not complete within 24 hours | Contact 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
使用限制
| Limitation | Description |
|---|---|
| Operating System | 32-bit operating systems not supported |
| Network Type | Classic network (经典网络) ECS not supported |
| Storage Type | Only block storage (块存储) supported; NAS/OSS and other network-mounted storage not supported |
| Dependent Service | Requires Cloud Assistant (云助手) service (ECS purchased before Dec 2017 requires manual installation of Cloud Assistant Agent) |
| ECS Spec | Recommended >= 1 vCPU, 512 MB memory for adequate backup performance |
| Data Volume | Low 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:
- Stop immediately - Do NOT execute installation checks, credential verification, parameter confirmation, or any CLI command
- 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")
- Recommend alternatives - Provide specific alternative products/features
- 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[终止流程] - 匹配到不推荐场景时必须执行:
- 立即停止操作 - 不要执行安装检查、凭证校验、参数确认或任何CLI命令
- 向用户输出警告 - 说明当前场景不适合使用ECS文件备份基础版的原因(引用「不推荐场景及替代方案」中的原因)
- 推荐替代方案 - 提供具体的替代产品/功能
- 结束当前任务 - 输出警告和替代方案后,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 versionEnable 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 truePre-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-hbrIf the plugin is not installed or the version is below 0.1.3, install/update:
bash
aliyun plugin install --names aliyun-cli-hbrAfter plugin installation, HBR commands and parameter names use kebab-case naming convention (e.g.,instead ofdescribe-backup-plans).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 RequiredSecurity 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
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 validaliyun configure listbashaliyun configure listConfirm the output shows a valid profile (AK, STS, or OAuth identity).If no valid credentials exist, configure first:
- Obtain credentials from Alibaba Cloud Console
- Run
in the terminal to configure credentialsaliyun configure- Re-run
to confirm successful configurationaliyun configure list
前置检查:需要阿里云凭证安全规则:
- 绝对不要以任何形式打印、输出AK/SK值(包括部分片段或掩码形式)
- 绝对不要在命令行参数、日志、对话输出或代码注释中暴露任何凭证内容
- 绝对不要直接在命令行中输入AK/SK
- 仅使用
检查凭证状态;绝对不要将该命令的输出回显给用户(输出可能包含凭证相关信息);Agent仅可内部使用该输出判断凭证是否有效aliyun configure listbashaliyun configure list确认输出显示有效配置(AK、STS或OAuth身份)。如果不存在有效凭证,先进行配置:
- 从阿里云控制台获取凭证
- 在终端运行
配置凭证aliyun configure- 重新运行
确认配置成功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.
| Parameter | Required/Optional | Description | Validation Regex | Example |
|---|---|---|---|---|
| Required | Region of the ECS instance (ECS实例所在地域) | | |
| Required | ECS Instance ID (ECS实例ID) | | |
| Required for some ops | Backup Plan ID (备份计划ID); needed for pause/resume/cancel | | |
| Required for restore | Backup Vault ID (备份仓库ID); obtained via | | |
| Required for restore | Snapshot ID (备份版本ID); obtained via | | |
| Required for restore | Snapshot Hash (备份版本哈希值); obtained via | | |
| Optional | Backup priority (备份优先级): | | |
| Required for restore | File conflict policy (文件冲突策略): | | |
| Required for restore | Idempotency token (幂等令牌); agent-generated UUID, reuse on timeout retry | | |
| Optional | Keep last backup version (保留最后一个备份版本): | | |
| Optional for restore | Source file path to restore (要恢复的源文件路径) | | |
| Required for restore | Restore target directory (恢复目标目录); must already exist | | |
重要:参数确认 - 执行任何命令前,所有可自定义参数必须和用户确认。 不要假设默认值,必须获得用户明确确认。 如果用户拒绝确认或未响应确认请求,Agent必须终止当前操作,不得继续执行后续步骤。
关键 - 安全门槛:将任何参数嵌入CLI命令前,Agent必须对照下表中的校验正则验证所有用户提供的参数。 校验失败时,Agent必须拒绝执行命令,告知用户哪个参数无效、预期格式是什么,等待用户提供有效值后重新校验。
| 参数 | 必填/可选 | 说明 | 校验正则 | 示例 |
|---|---|---|---|---|
| 必填 | ECS实例所在地域(ECS实例所在地域) | | |
| 必填 | ECS实例ID(ECS实例ID) | | |
| 部分操作必填 | 备份计划ID(备份计划ID),暂停/恢复/取消操作需要 | | |
| 恢复操作必填 | 备份仓库ID(备份仓库ID),可通过 | | |
| 恢复操作必填 | 备份版本ID(备份版本ID),可通过 | | |
| 恢复操作必填 | 备份版本哈希值(备份版本哈希值),可通过 | | |
| 可选 | 备份优先级(备份优先级): | | |
| 恢复操作必填 | 文件冲突策略(文件冲突策略): | | |
| 恢复操作必填 | 幂等令牌(幂等令牌),Agent生成的UUID,超时重试时复用 | | |
| 可选 | 保留最后一个备份版本(保留最后一个备份版本): | | |
| 恢复操作可选 | 要恢复的源文件路径(要恢复的源文件路径) | | |
| 恢复操作必填 | 恢复目标目录(恢复目标目录),必须已存在 | | |
RAM Permissions
RAM权限
This Skill requires the permissions detailed in references/ram-policies.md.
Recommended system policy:
AliyunHBRFullAccess该Skill需要的权限详情请查看references/ram-policies.md。
推荐系统策略:
AliyunHBRFullAccessCore 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-SkillsIdempotent 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-SkillsIdempotent 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: -> ->
PreparingReadyBacking 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-SkillsExtractfrom the response.PlanId
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-SkillsIdempotent 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-SkillsIdempotent 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-SkillsStep 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-SkillsAfter 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-SkillsStep 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-Skillsreturns backup jobs sorted by creation time in descending order; the first record is the latest execution result.describe-backup-jobs-2
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-clientsAuxiliary 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-SkillsView 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-Skills6. View Free Quota & Capacity
6. 查看免费额度与容量
bash
aliyun hbr get-basic-statistics \
--source-type ECS_FILE \
--read-timeout 60 \
--user-agent AlibabaCloud-Agent-SkillsKey field: is the total block storage capacity of backed-up ECS instances (in bytes).
GlobalStatistics.ProtectedDataSizeFree 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关键字段:为已备份ECS实例的块存储总容量(单位:字节)。
GlobalStatistics.ProtectedDataSize免费额度规则:每个账号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, andSnapshotIdcan be obtained viaSnapshotHash. Omittingsearch-historical-snapshotsrestores all files in the snapshot.--includemust be an existing directory on the target ECS instance; otherwise the restore job will report aTargetPatherror. Using theTARGET_NOT_EXISTpolicy 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. UseOVERWRITE_EXISTINGto ensure idempotency; the agent should generate a UUID as the ClientToken and reuse the same token on timeout retries to prevent duplicate restore jobs.--client-token
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-Skillsbash
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必须是目标ECS实例上已存在的目录,否则恢复任务会报TargetPath错误。 使用TARGET_NOT_EXIST策略会覆盖目标路径下的同名文件,执行前必须获得用户明确确认。如果用户未确认,Agent必须终止恢复操作。 使用OVERWRITE_EXISTING保证幂等性,Agent应生成UUID作为ClientToken,超时重试时复用相同令牌,避免重复创建恢复任务。--client-token
查看恢复进度
bash
aliyun hbr describe-restore-jobs-2 \
--region <REGION_ID> \
--edition BASIC \
--restore-type ECS_FILE \
--read-timeout 60 \
--user-agent AlibabaCloud-Agent-Skills8. 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-SkillsStep 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-SkillsSchedule format:, where start_timestamp is a Unix timestamp in seconds, andI|<start_timestamp>|P1Dmeans once per day (fixed for Essential Edition). Idempotent operation; safe to call repeatedly.P1D
步骤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调度格式:,其中start_timestamp是秒级Unix时间戳,I|<start_timestamp>|P1D表示每天1次(基础版固定)。 幂等操作,重复调用安全。P1D
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= keep the last backup version (recommended);1= do not keep; all backup points older than 30 days will be automatically deleted. Idempotent operation; safe to call repeatedly.0
开启后,即使所有备份版本超出保留周期,系统也会保留最后一个版本不删除。
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= 不保留,超过30天的所有备份点会自动删除。 幂等操作,重复调用安全。0
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-SkillsSeein the Parameter Confirmation table for valid values; detailed use cases are described in references/related-apis.md. Idempotent operation; safe to call repeatedly.performanceLevel
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有效值请参考参数确认表中的说明,详细使用场景请查看references/related-apis.md。 幂等操作,重复调用安全。performanceLevel
Verification
验证
See references/verification-method.md for details.
详情请查看references/verification-method.md。
References
参考文档
| Document | Link |
|---|---|
| CLI Installation Guide | references/cli-installation-guide.md |
| API & CLI Command Reference | references/related-apis.md |
| RAM Permission Policies | references/ram-policies.md |
| Verification Methods | references/verification-method.md |
| Official User Guide | ECS File Backup Essential Edition |
| Cloud Backup API Docs | HBR 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参考 |