All Products
Search
Document Center

Cloud Backup:Back up files from an ECS instance

Last Updated:Aug 06, 2025

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

Prerequisites

You must activate the Alibaba Cloud Cloud Backup service. Activating Cloud Backup is free of charge. If you use the ECS file backup feature of Cloud Backup, you are charged for client and storage usage. For more information, see ECS file backup fees.

Usage notes

  • For optimal backup performance, we recommend that you run the Cloud Backup client on a host with a 64-bit CPU that has two or more cores and more than 8 GB of available memory.

  • The amount of data that can be backed up depends on the available memory. A host with 4 GB of available memory can back up a maximum of one million files, totaling up to 8 TB. If you want to back up tens of millions of files, we recommend that the host has 16 GB of available memory.

  • When you create a backup plan or associate a backup policy for the first time, Cloud Backup automatically creates a service-linked role named AliyunServiceRoleForHbrEcsBackup to obtain permissions to access related resources. In the dialog box that appears, assign the role as prompted. For more information, see Service-linked roles for Cloud Backup.

  • The Cloud Backup client for ECS requires Alibaba Cloud Cloud Assistant.

    • If you purchased the ECS instance before December 1, 2017, you must manually install the Cloud Assistant Agent. For more information, see Install Cloud Assistant Agent.

    • If you purchased the ECS instance on or after December 1, 2017, the Cloud Assistant Agent is pre-installed.

Create a backup plan to periodically back up ECS files

  1. Log on to the Cloud Backup console.

  2. In the navigation pane on the left, choose Backup > ECS File Backup.

  3. In the top navigation bar, select a region.

  4. On the ECS File Backup page, go to the ECS Instances tab. Find the target instance and click Back Up in the Actions column.

  5. In the Create Backup Plan panel, configure the parameters and click OK.

    Important
    • If the selected region supports backup policies, you must associate the backup plan with a backup policy. Cloud Backup then periodically backs up ECS files based on that policy.

    • To view the regions that support backup policies, click Policy Center in the navigation pane. For more information about how to create a backup policy, see Create a new backup policy.

    Parameter

    Description

    Backup Folder Rule

    Specify the directory to be backed up. Cloud Backup backs up all files and subdirectories of the directory.

    Select All Folders or Specified Folders.

    • If you select All Folders, you must turn on or off Exclude System Folders.

      • If you turn on Exclude System Folders, the system folders in Windows and Linux are not backed up.

        You can click the question mark icon to the right of Exclude System Folders to view more details.

      • If you turn off Exclude System Folders, all folders are backed up.

    • If you select Specified Folders, you must specify the Source Paths. To specify multiple backup directories, you can click Add Folder.

      The following rules apply to source paths:

      • If you do not use a wildcard character (*), you can enter eight paths.

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

      • Only absolute paths are supported, such as paths that start with /, \\, C:\, or D:\.

      • If you use Volume Shadow Copy Service (VSS), multiple paths, UNC paths, wildcard characters, and file exclusion are not supported.

      • If you use Universal Naming Convention (UNC), VSS, wildcard characters, and file exclusion are not supported. If the backup source contains a UNC path, the Windows access control list (ACL) is not backed up.

    Exclude System Folders

    Turn on the Exclude System Folders switch to exclude system folders from backups.

    Backup File Type

    Select All Types or Specified Type.

    • If you select All Types, all types of files are backed up.

    • If you select Specified Type, you must select the types of the files that you want to back up from the Select File Type box.

    Backup Policy

    Select a proper backup policy from the drop-down list.

    Cloud Backup automatically backs up data sources based on the backup policy that you configure. Backup policies help you flexibly manage data sources. A backup policy includes the following settings: backup vault encryption method, backup interval, retention period, geo-redundancy policy, automatic archiving of backup data, and virus detection for backup points.

    If the default backup policy does not meet your requirements, you can click Manage Policy to go to the Policy Center page to create or modify a backup policy.

    For more information about the parameters in a backup policy, see Manage backup policies.

    Enable Bandwidth Throttling

    Traffic shaping can help you control the traffic of backup files during peak hours to avoid affecting normal business.

    If you use traffic shaping, you need to select a Time Range, enter the Maximum Bandwidth that can be used for backup within the time range, and then click Add.

Successful backup

  • When the scheduled backup time is reached, Cloud Backup starts a backup job. You can go to the Backup Jobs tab to view the job status. If the Status is Completed, the backup was successful. You can view details about the backup job, such as Total Scan, Completed Backups, Written To Vault, and Backup Speed. For more information about these metrics, see the prompts in the Cloud Backup console.

    Note

    For backup jobs completed on or after June 1, 2025, the Total Scan, Completed Backups, and Written to Vault metrics display both the data size and the number of files. For backup jobs completed before June 1, 2025, these metrics display only the data size.

    image

  • On the Backup Plans tab, click the image icon next to the target ECS instance to view the backup records and information about the generated backup points in the Backup History section. You can restore ECS files from historical backup points.

    image

Troubleshooting

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

  • Client Status: Not Installed

    • If a backup client is not installed on an ECS instance, the instance cannot be backed up. We recommend that you install the client and use the ECS file backup feature to back up important data.

    • You do not need to manually install a backup client to back up files from ECS instances. When you create a backup plan for an ECS instance, Cloud Assistant automatically installs a backup client. After the client is installed, the Client Status is Activated and the version number of the client is also displayed.

  • Status of the backup job: Failed

    • Modify the configurations as prompted in the error message.

    • View the logs and locate the error code.

      Note

      The backup client is installed in one of the following paths by default. The following paths are for reference only. The actual installation path may be different.

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

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

  • Status of the backup job: Partially Completed

    Download the list of files that were not backed up, review them, resolve the issues based on the error messages, and then run the backup job again.

Browse and download backup files

  • Browse backup files

    You can use the Browse feature to view files that have been backed up. If virus detection has been performed on a backup point, Cloud Backup marks the files that are infected with viruses.

    1. On the Backup Plans tab, find the target backup plan and click image.

    2. In the Backup History section, find the backup point that you want to view, click it, and then select Browse.

    image

  • Download backup files

    You cannot directly download backup files. Instead, you must restore them to a specified path. For example, if you set Restore Path Type to Specify Path and set Destination Path to /temp/path, the backup files are restored to that path after the restore job is complete. You must create the destination path before you start the restore job. Otherwise, the restore job fails.

Extend the retention period of a backup point

If you want to store ECS file backup data for a longer period, you can extend the retention period of the corresponding backup point.

Note
  • The retention period of a backup point can be extended but cannot be shortened.

  • You cannot extend the retention period of a backup point that is already set to be retained permanently.

  1. On the Backup Plans tab, click the image icon next to the target ECS instance.

  2. In the Backup History section, find the backup point whose retention period you want to extend. Click the backup point and set Specify Time or select Never Expire.

    image

  3. Click Save.

After you extend the retention period, you can view the new expiration time in the Expires At column.

image

Virus detection

To prevent virus-infected files from being restored to your production environment, Cloud Backup provides the Backup Point Virus Detection feature. This feature helps you select a clean and safe backup point for data restoration. You can click Virus Detection to check for viruses. For more information, see Backup point virus detection.

Reinstall a backup client

Warning

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

  • If a NAS directory is mounted to the installation path, you need to run the umount command to unmount the NAS directory. This prevents the NAS files from being accidentally deleted.

  • If other important directories or files exist in the installation path, move them to another directory. This prevents these important files from being accidentally deleted.

On the ECS Instances tab, find the target instance and choose More > Install Client in the Actions column. After the client is installed, the client status changes to Activated.

image

If the client status is abnormal, see the following documents for troubleshooting information.

Uninstall a client

Warning

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

  • If a NAS directory is mounted to the installation path, you need to run the umount command to unmount the NAS directory. This prevents the NAS files from being accidentally deleted.

  • If other important directories or files exist in the installation path, move them to another directory. This prevents these important files from being accidentally deleted.

On the ECS Instances tab, find the target instance and choose More > Uninstall Client in the Actions column. After the client is uninstalled, the client status changes to Not Installed.

image

Delete backups

You can delete the backup data that was generated by a specific backup client.

Warning

This action deletes all backup data generated by the client and causes any ongoing backup or restore jobs to fail. Before you proceed, make sure that you no longer need the backup data for this client and that no backup or restore jobs are running.

  1. On the Backup Plans tab, find the target backup plan and click the image icon next to it.

  2. In the Backup History section, find the backup point that you want to delete, click the backup point, select Delete, and then confirm the deletion.

image

Set alerts for backup jobs

To receive timely notifications about exceptions that occur on the backup client or during a backup or restore job, find the target instance on the ECS Instances tab. In the Actions column, choose More > Alert Settings and configure alert notifications for the backup jobs of the instance.

image

Alerting Method

Description

Disabled

The client no longer sends alert notifications.

Same as Backup Vault

The client uses the same alerting method as the backup vault.

Notify Alibaba Cloud Account

Backup alert notifications for this client are sent to the Alibaba Cloud account by email.

Custom

You must select one or more contacts or groups. After the configuration is complete, the client sends backup alerts to the selected contacts or groups. For more information, see Manage alert contacts.

Configure client parameters

To optimize client performance, find the target instance on the ECS Instances tab and choose More > Client Settings in the Actions column. We recommend that you use the default configurations.

image

Client settings

Description

Use HTTPS

You can choose whether to transmit data over HTTPS. Because HTTPS transmission involves encryption and decryption, it may affect transmission performance. If you modify this configuration, the change takes effect when the next 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 it is stored in the backup vault.

Data Network

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

Maximum number of worker threads

Specifies the maximum number of threads that can be run on the backup client. A larger number of threads use more resources on the host and have more negative impacts on the performance of the host. We recommend that you specify a suitable value based on your evaluation.

Maximum CPU Cores

Specifies the maximum number of CPU cores that can be used on the backup client. A larger number of CPU cores use more resources on the host and have more negative impacts on the performance of the host. We recommend that you specify a suitable value based on your evaluation.

Restore ECS files

For more information, see Restore ECS files.

Cross-region backup

To ensure business continuity in the event of a regional disaster, Cloud Backup lets you create a geo-redundant mirror vault for a backup vault whose Vault Type is General-purpose Backup or Tablestore Backup. For a general-purpose backup vault that stores ECS files, you can create a mirror vault to enable cross-region disaster recovery. After the mirror vault is created, data in the source backup vault is automatically replicated to the mirror vault to ensure data consistency between the two regions. You can also perform cross-region data restoration from the mirror vault when needed. For more information, see Cross-region backup. In addition, ECS file backup supports enterprise-level features such as cross-account backup, automatic data archiving, KMS encryption, backup locking, backup point virus detection, and automatic association of backups with resources based on tags.

Configure retry parameters for failed ECS file backups

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

  1. Log on to the server where you want to back up files.

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

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

    Note

    The hbr.config file is in the same directory as the hbrclient and ids executable programs.

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

    Parameter

    Description

    retry_times

    The number of data backup retries on clients whose version is 2.16.0 or later. Default value: 30.

    retry_interval

    The interval at which data backup is retried on clients whose version is 2.16.0 or later. Default value: 1000 ms.

    skip_error_files

    Specifies whether to skip files that fail to be backed up.

    • false (default): does not skip the files that fail to be backed up.

    • true: skips the files that fail to be backed up.

    The following sample code provides an example of the configuration of the hbr.config file:

    retry_times=30
    retry_interval=1000
    skip_error_files=false

References

  • To back up multiple ECS instances at a time for local redundancy or geo-redundancy, or to quickly build and replicate an ECS test environment, we recommend that you use the ECS instance backup feature. For more information, see Overview of the ECS instance backup feature.

  • Disk backup creates crash-consistent backups of all disk types (including system disks and data disks) for an ECS instance. You can use the backups to back up or restore an entire disk. For more information, see Create a disk backup.

  • Back up files from a local server.

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

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

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