Back up ECS files

更新时间:
复制 MD 格式

To prevent data loss from accidental file deletion or server viruses, you can back up all directories and files on your Elastic Compute Service (ECS) instances using Cloud Backup. Cloud Backup lets you set flexible backup policies to back up data to the cloud. You can view and restore your data at any time. This topic describes how to use Cloud Backup to back up files on an ECS instance.

Prerequisites

The Alibaba Cloud Cloud Backup service is activated. Activating Cloud Backup is free. However, using the ECS File Backup feature of Cloud Backup incurs software usage fees and storage capacity fees. For more information, see ECS File Backup Fees.

Notes

  • For optimal backup speed, run the Cloud Backup client on a machine with a 64-bit dual-core CPU or higher and at least 8 GB of available memory.

  • The amount of data that you can back up depends on your memory resources. With 4 GB of available system memory, you can back up a maximum of 1 million files, totaling 8 TB of data. If a directory contains tens of millions of files or more, use at least 16 GB of available memory.

  • When you create a backup plan or attach a backup policy for the first time, Cloud Backup automatically creates the AliyunServiceRoleForHbrEcsBackup service-linked role. This role is used to access related resources. An authorization dialog box appears. You must grant permissions to the role as prompted.

  • The ECS backup client must be used with Alibaba Cloud Cloud Assistant. For ECS instances that were purchased before December 1, 2017, you must manually install the Cloud Assistant Agent.

  • Starting from client version 2.31.0, when you back up ECS files, the system automatically excludes specific directories and their contents. The default exclusion rules are as follows:

    Note

    When you create a backup plan, you can click the tooltip icon for Exclude System Folders to view the directories that are excluded by default.

    The default excluded directories differ for the Basic and Standard editions:

    • Standard Edition

      • Linux file system: By default, /dev/, /proc/, /sys/, /boot/, /run/, /var/run/, /lost+found/, and the client installation directory are excluded.

      • Windows file system: By default, Users\Administrator\AppData\Local\Microsoft\Windows\UsrClass.dat, Users\Administrator\UsrClass.dat, Users\Administrator\NTUSER.DAT, Users\Administrator\ntuser.dat.LOG*, %SYSTEMDRIVE%\Boot, %SYSTEMDRIVE%\Windows, %VOLUME%\System Volume Information\, %VOLUME%\$Recycle.Bin, %VOLUME%\pagefile.sys, %VOLUME%\hiberfil.sys, and the client installation directory are excluded.

    • Basic Edition

      • Linux file system: By default, /bin/, /usr/bin/, /sbin/, /usr/sbin/, /srv/, /selinux/, /lib/, /lib32/, /lib64/, /boot/, /run/, /dev/, /proc/, /sys/, /lost+found/, and the client installation directory are excluded.

      • Windows file system: By default, Windows\, python27\, Program Files (x86)\, Program Files\, ProgramData\, Boot\, $RECYCLE.BIN\, System Volume Information\, Users\Administrator\NTUSER.DAT, Users\Administrator\ntuser.dat.LOG*, pagefile.sys, and the client installation directory are excluded.

Video tutorial

Back up ECS files

Create a backup plan

  1. At the top of the ECS File Backup page, select the region of the ECS instance to back up, and then click Add ECS File Backup.

    Note

    If you are using the Legacy Console (identified by Try New Version in the upper-right corner), go to the ECS Instances tab, find the target instance, and click Back Up in the Actions column.

  2. In the Create Backup Plan panel, configure the parameters described in the following table.

    Parameter

    Description

    ECS To Back Up

    Select the ECS instances that you want to back up. You can select multiple ECS instances to create backup plans in batches.

    Note

    If you are using the Legacy Console, this parameter is automatically determined by the selected ECS instance and does not need to be configured.

    Backup Folder Rule

    Specify the directories to back up. Cloud Backup backs up all files and subdirectories in the specified directories.

    Select All Folders or Specified Folders.

    • If you select All Folders, select whether to enable Exclude System Folders.

      • If you enable Exclude System Folders, the excluded system directories for Windows and Linux are not included in the backup plan.

        You can click the Question mark icon to the right of Exclude System Folders to obtain the details of the excluded system directories.

      • If you do not enable Exclude System Folders, all directories are included in the backup plan.

    • If you select Specified Folders, you must specify Source Paths. Click Add Folder to specify multiple backup directories.

      The backup path rules are as follows:

      • Without a wildcard character (*), you can enter up to eight paths.

      • If you use a wildcard character (*), you can enter only one path. Wildcard characters such as /*/* are supported.

      • Each line must be an absolute path, starting with /, \\, C:\, or D:\.

      • When you use VSS, multiple paths, UNC paths, wildcard characters, and file exclusions are not supported.

      • When you use UNC, VSS, wildcard characters, and file exclusions are not supported. When the backup source contains a UNC path, Windows ACLs are not backed up.

    Backup File Type

    Select All Types or Specified Type.

    • If you select All Types, all file types are backed up, regardless of the file extension.

    • If you select Specified Type, you must specify the file types to back up in the Select File Type box.

    Backup Policy

    Select a backup policy from the drop-down list.

    Cloud Backup automatically backs up data sources based on the backup policy you set. A backup policy includes settings such as backup vault encryption, backup interval, retention period, geo-redundancy replication policy, automatic backup archiving, and backup point virus scan. These settings help you flexibly manage your data source assets.

    If the default backup policy does not meet your backup requirements, you can click Create Backup Policy or Edit Policy to manage backup policies. For more information about the parameters in backup policies, see Policy Center.

    Use VSS

    Specifies whether to use the Volume Shadow Copy Service (VSS) feature of Windows to accelerate backups. This feature is available only for Windows operating systems.

    Note

    When you use VSS, you cannot back up multiple paths or UNC paths, use wildcard characters, or exclude files.

    To use VSS, turn on the Use VSS switch.

    Enable Bandwidth Throttling

    Traffic shaping helps you control backup traffic during peak business hours to avoid affecting normal business operations.

    To use traffic shaping, turn on the Enable Bandwidth Throttling switch. Select a Time Range (Hour) as needed, enter the Max Bandwidth (MByte/s) for backups within the time window, and then click Add.

  3. Click OK to complete the configuration.

Backup running status

Backup Running Status

Description

Preparing

The resource is being prepared for backup (for example, the backup client is being installed). After the preparation is complete, the resource is automatically backed up based on the specified backup policy.

Preparation Failed

The backup client failed to be installed. View the error details in the console.

Ready

The backup client is installed and waiting for the first backup to start.

Backing Up

The backup status is normal. The system is waiting for the next backup job to run.

Backing Up (In Progress)

The backup status is normal, and a backup job is running.

Paused

All backup plans for this resource are paused. You can go to the backup plans list on the backup details page and enable any backup plan to continue backups.

Stopped

The backup resource cannot be found (the original resource may have been released). The backup data is automatically deleted after it expires. You can view the expiration time of the backup or restore data from the backup history list on the backup details page.

View backup jobs

When the scheduled backup time arrives, Cloud Backup runs the backup job.

Note

The backup progress percentage is dynamically estimated by the system based on the current data volume and is for reference only. It does not represent the precise completion percentage. During the backup process, the displayed total scanned size may be smaller than the actual total data size because the data scan may not be complete. The final status of the backup job determines its completion.

On the Backup Jobs tab, a Status of Completed indicates that the backup job was successful. You can view details such as Total Scanned Data at Source, Backed Up Data, Data Written to Vault, and Backup Speed. For a description of each metric, refer to the tooltips in the Cloud Backup console.

Note
  • For backup jobs completed on or after June 1, 2025, statistics for data volume and file count are displayed for Total Scanned Data at Source, Backed Up Data, and Data Written to Vault. For backup jobs completed before this date, only data volume statistics for these metrics are displayed.

  • Only backup job records from the last six months can be viewed in the job list. To access more data, you can export it through Report Audit.

To cancel a one-time backup job that is in progress, click Cancel in the Actions column and confirm the action.

Manage backup content

On the ECS File Backup page, select the region of the target ECS instance and click View Details for that instance to manage its backup content in the Backup History section.

Note

If you are using the Legacy Console, which displays Try New Version in the upper-right corner, go to the Backup Plans tab and click the image icon next to the target instance to perform an operation. The available operations are the same as those shown after you switch the display mode by clicking the image icon.

Browse backup files

You can use the Browse feature to view backed-up files. If a backup point has been scanned for viruses, Cloud Backup marks any infected files.

  1. In the Backup History section, click Browse in the Actions column for the target backup point.

    Alternatively, click the image icon on the right of the backup history to switch the display mode. Then, click the target backup point and select Browse.

  2. In the Browse panel, you can view the backed-up ECS files.

Note

You cannot download backed-up files directly. To download the files, you must first restore them to a specified path. For example, set Restore Path Type to Specify Path and set Destination Path to /temp/path. You must create this path before you start the restore job. Otherwise, the job will fail. After the restore job is complete, the files from the backup point are downloaded to this path.

Extend the retention period of a backup point

To keep ECS file backup data for a longer time, you can extend the retention period of a backup point.

Important
  • The retention period of a backup point can only be extended, not shortened.

  • The retention period of a backup point that is set to permanent cannot be extended.

  1. In Backup History, click the image icon in the Expires At column for the target backup point.

    You can also click the image icon on the right side of the backup history to switch the display mode. Then, click the target backup point and then the image icon to the right of Expires At.

  2. Set a Schedule Time or select Never Expire. Then, click Save.

    After the configuration is complete, the new expiration time is displayed in the Expires At column.

Delete backups

This section describes how to delete backup points created by the backup client.

Important
  • Deleted backup points cannot be recovered. Proceed with caution.

  • If the "Keep at least one backup version" setting is enabled in the backup plan, you cannot delete the latest backup. If you are sure that you want to delete this backup, you must first disable the "Keep at least one backup version" setting in the backup plan.

To delete backup points from the Backup History section in list view, use one of the following methods.

  • To delete a single backup point, find the target backup point, click Delete in the Actions column, and then confirm the deletion.

  • To delete backup points in batches, select the target backup points, click Delete Backup Point below the list, and then confirm the deletion.

Alternatively, click the image icon to the right of the backup history to switch the display mode. Then, click the target backup point and select Delete.

Manage backup plans

On the ECS File Backup page, select the region where the target ECS instance is located. Click View Details to the right of the target ECS instance, and then click the Backup Plans tab to manage the backup plans.

Note

If you are using the Legacy Console (indicated by the Try New Version button in the upper-right corner), go to the Backup Plans tab and select the desired action in the Actions column for the target instance.

Run a backup job immediately

In the Actions column of the backup plan, select > Run Now to start a backup immediately.

Modify a backup plan

  1. In the Actions column, click Modify for the backup plan.

  2. In the Configure Plan panel, you can modify the basic settings, backup policies, and other configurations as needed.

  3. Click OK.

Pause or resume a backup plan

Backup plans are enabled by default. To stop data backups for a specific period, you can pause the backup plan. You can then resume the plan when you need to back up data again.

  • Pause a backup plan: Turn off the switch in the Plan Status column or select > Suspend Plan in the Actions column. Then, confirm the pause.

    After a backup plan is paused, subsequent backup jobs will not run. Existing backup points are not affected and will expire automatically based on the set retention period. If "Keep at least one backup version" is enabled, the last backup version is not affected by the retention period. Billing for the ECS instance continues as long as backup points exist.

  • Resume backup plan: You can turn on the switch in the Plan Status column or select > Resume Plan in the Actions column.

Delete a backup plan

Important
  • You cannot delete a backup plan if the instance has backups. You must delete the backups first. If you want to stop the backup plan from running before you delete backups, you can pause the plan.

  • Deleted backup plans cannot be recovered. When all backup plans and backup points for an ECS instance are deleted, the instance is removed from the list of backed-up ECS instances.

Select > Delete Plan in the Actions column of the backup plan, and confirm the deletion.

Manage the backup client

At the top of the ECS File Backup page, select the region where the target ECS instance is located, click View Details to the right of the target ECS instance, and then manage the backup client in the Client Information area.

Note

If you are using the Legacy Console, which displays Try New Version in the upper-right corner, go to the ECS Instances tab, find the target instance, and select the desired function from the Actions column.

Reinstall the backup client

Warning

Before you install the client, you must check the client installation path:

  • If a NAS directory is already mounted to the installation path, you must use the umount command to unmount the NAS directory to avoid accidental deletion of NAS files.

  • If other important directories and files exist in the installation path, you must move them to another directory to avoid accidental deletion of important files.

To the right of Client Operation, click > Reinstall. After the reinstallation is complete, the client status changes to Activated.

Manually install the backup client on the ECS instance (ECS File Backup installs the client automatically. Manual installation is not recommended unless it is necessary.)

  1. Download the backup client.

    1. On the Local File Backup page, on the Local File Data Source tab, click Add Client.

      Note

      If you are using the Legacy Console (Try New Version in the upper-right corner), click Add Client on the Clients tab.

    2. In the Add Client pane, download the client (Windows or Linux) that matches the operating system of the ECS instance.

  2. Install the backup client on the ECS instance that you want to back up.

    1. Upload the downloaded client to the ECS instance. For more information, see Upload or download files on the instance details page.

    2. The installation method depends on the operating system of the ECS instance.

      • Windows: Decompress the client installation package and double-click the installation program. Follow the on-screen prompts to complete the installation. During installation, select ECS File Backup Client as the installation type.

        image

      • Linux client: Connect to the instance through Workbench, decompress the client installation package, navigate to the directory that contains the client installation file, and then run the ./setup command to complete the installation.

        image

  3. Check the status of the backup client on the ECS instance.

    On the Backup Details tab for the target ECS instance, verify that the Client Status is Activated.

    Note

    If you are using the Legacy Console (with Try New Version in the upper-right corner), check the status on the ECS Instances tab.

If the client status is abnormal, see Troubleshoot and handle abnormal file backup client status, How to check the running status of the Cloud Backup client, and How to view the default installation path and logs of the Cloud Backup client for troubleshooting.

Set client parameters

Next to Client Operation, click Client Settings. Configure the client parameters and save the settings. We recommend using the default configurations.

Client Settings

Description

Use HTTPS

Specifies whether to use the HTTPS protocol for data transmission. Because HTTPS transmission involves encryption and decryption, it may affect transmission performance. If you modify this configuration, it will take effect the next time a backup or restore job starts.

Note

This setting only affects data security during network transmission. Regardless of whether HTTPS is enabled, backup data is encrypted when stored in the backup vault.

Data Network

Select whether to transmit data over a VPC or the Internet. If your client is deployed in an Alibaba Cloud VPC, or if it is connected to an Alibaba Cloud VPC through a leased line, select VPC as the transmission network.

Maximum number of worker threads

Set the maximum number of worker threads for the backup client. A higher number of threads consumes more host resources and has a greater impact on host performance. Set this value after evaluation.

Maximum CPU Cores

Set the maximum number of CPU cores that the backup client can use. A higher number of CPU cores consumes more host resources and has a greater impact on host performance. Set this value after evaluation.

Alarm When Job Partial Completed

Some system files or files exclusively used by other programs may be skipped during backup, resulting in a partially completed backup job. After enabling client alert settings, you can set whether to alert for partially completed backup jobs.

To alert for partially completed backup jobs, turn on the Alarm When Job Partial Completed switch.

Set retry parameters

If a file backup fails due to factors such as network instability, you can configure retry parameters.

  1. Log on to the server whose files need to be backed up.

  2. Switch to the default installation directory of the Cloud Backup client.

  3. In the client folder, create a file named hbr.config.

    Note

    The hbr.config file is at the same level as the hbrclient and ids executables.

  4. Add the following parameters to the hbr.config file.

    Parameter

    Description

    retry_times

    For client versions 2.16.0 and later, this is the number of retry attempts for data backup. The default is 30.

    retry_interval

    For client versions 2.16.0 and later, this is the retry interval for data backup. The default is 1000 milliseconds.

    skip_error_files

    Specifies whether to skip files that fail to back up.

    • false (default): Does not skip files that fail to back up.

    • true: Skips files that fail to back up.

    The following code provides a configuration example for the hbr.config file:

    retry_times=30
    retry_interval=1000
    skip_error_files=false

Uninstall the client

Warning

Before you uninstall the client, you must check the client installation path:

  • If a NAS directory is already mounted to the installation path, you must use the umount command to unmount the NAS directory to avoid accidental deletion of NAS files.

  • If other important directories and files exist in the installation path, you must move them to another directory to avoid accidental deletion of important files.

To the right of Client Operation, you can select > Uninstall. After the client is uninstalled, its status changes to Unmounted.

Cancel the backup for an ECS instance

Warning
  • When you cancel the backup for an ECS instance, Cloud Backup deletes the backup data for that instance. This action causes running backup or restore jobs to fail, stops billing, and removes the ECS instance from the backup list.

  • Before you cancel the backup, make sure that you no longer need the backup data for the ECS instance and that no backup or restore jobs are running.

At the top of the ECS File Backup page, select the region of the target ECS instance and click View Details in the Actions column for that instance. On the Backup Details tab, click Stop Backup to the right of Backup Running Status and confirm the cancellation.

Note

If you are using the Legacy Console (Try New Version is displayed in the upper-right corner), on the ECS Instances tab, for the target ECS instance, select > Delete Backup in the Actions column and confirm the operation.

Enterprise-grade features

Virus scan

The Cloud Backup service provides a backup point virus scan feature to prevent files that contain viruses from being restored to the production environment. This feature helps you select clean and safe backup points for data restoration. On the Backup Details tab, find the target backup point in the Backup History area. In the Actions column, click the ... > Virus Detection to scan the files for viruses.

Backup vault replication

To maintain business continuity and protect against regional disasters or account management risks, Cloud Backup supports configuring cross-region backup or cross-account replication for backup vaults where the Vault Type is General Backup. After configuration, data from the source backup vault is automatically synchronized to the replication target vault, ensuring data consistency between the two locations. You can also perform cross-region data restoration from the replication target vault as needed.

For general backup vaults that store ECS files, configuring backup vault replication provides cross-region or cross-account disaster recovery protection for your data.

In addition, ECS File Backup also supports enterprise-grade features such as cross-account backup, automatic archiving, KMS encryption, backup lock, and automatic resource association for backup based on tags.

Troubleshoot backup exceptions

When the Status of a client or backup job is abnormal, refer to the following suggestions.

  • Client Status: Not Installed

    • The backup client is not installed on the ECS instance. This means you have not protected this ECS instance with backups. We strongly recommend that you use this feature to back up important data.

    • With ECS File Backup, you do not need to manually install the backup client. When you create a backup plan for an ECS instance, Cloud Assistant automatically installs the client. Once the installation is complete, the Client Status is updated to Activated, and the client version number is displayed.

  • The backup status is Failed.

    • Follow the on-screen prompts to modify and confirm that the configuration is correct.

    • View the log to locate the specific ErrorCode.

      Note

      The default installation paths for the backup client are as follows. Use the actual installation path in your operations.

      • Windows log path: Local Disk (C) > Program Files > Aliyun Hybrid Backup Service Client > logs

      • Linux log path: /opt/alibabacloud/hbrclient/logs

  • The backup status is Partially Completed.

    Download the list of files that failed to back up. Check each file and take the action suggested by the error message. Then, run the backup job again.

    Note

    If you used the VSS feature when you backed up files on a Windows ECS instance, the file path in the error message includes shadow_ali_ids, which is the path where VSS snapshot data is located. You can ignore this information. For example, if the error message shows the path E:\shadow_ali_ids\test, the actual file path is E:\test.

  • If you need more assistance, see Online technical support.

References

  • When you need to perform local or geo-redundant backups for ECS instances in batches, or need to quickly build and replicate ECS test and development environments, we recommend that you use ECS instance backup.

  • Cloud Backup provides resource plans for various backup scenarios. These plans offer price discounts to help you reduce costs. For more information, see Resource plan purchase guide.

  • To back up MySQL, Oracle, or SQL Server databases on an ECS instance, see Back up MySQL, Back up Oracle, and Back up SQL Server. Before you back up a database, you need to register the database in the Cloud Backup console.

  • To back up files from a local server to the cloud, see Back up local files.