All Products
Search
Document Center

Elastic Compute Service:Enable automatic saving for Cloud Assistant commands

Last Updated:Nov 07, 2025

For enhanced security, starting with Cloud Assistant Agent version 2.x.3.704, commands executed by Cloud Assistant are no longer saved to the local disk of an instance by default. To view historical command scripts inside an instance, such as for auditing or troubleshooting, follow the instructions in this topic to manually enable automatic saving.

Procedure

To enable this feature, run the commands for the operating system of your instance.

Linux / FreeBSD instances

On your Linux or FreeBSD instance, run the following two commands to enable automatic script saving.

  1. Set the configuration item

    aliyun-service configure set --item task.keepScriptFile=enabled
  2. Reload the configuration

    aliyun-service configure reload

Windows instances

On your Windows instance, open PowerShell as an administrator, and then run the following two commands.

Note: Replace {version} in the commands with the actual version number of your Cloud Assistant Agent. For more information, see View the Cloud Assistant Agent information for an ECS instance.

  1. Set the configuration item

    C:\ProgramData\aliyun\assist\{version}\aliyun_assist_service.exe configure set --item task.keepScriptFile=enabled
  2. Reload the configuration

    C:\ProgramData\aliyun\assist\{version}\aliyun_assist_service.exe configure reload

View saved script files

After you enable automatic saving, Cloud Assistant saves executed command scripts to a specific folder on the instance. To view the files, access the path that corresponds to your operating system:

  • Standard Linux systems: /usr/local/share/aliyun-assist/work/script/

  • CoreOS systems: /opt/local/share/aliyun-assist/work/script/

  • Windows systems: C:\ProgramData\aliyun\assist\work\script\