Schedule automatic disk file cleanup across multiple ECS instances with CloudOps Orchestration Service (OOS) to prevent disk space exhaustion.
CloudOps Orchestration Service (OOS) is a free cloud-based O&M automation platform that standardizes tasks as code. See What is CloudOps Orchestration Service?.
Prerequisites
-
ECS instances are in the Running state.
-
The Cloud Assistant Agent is installed on the ECS instances.
Procedure
Back up data on the ECS instances before running a cleanup task to prevent data loss. For example, create snapshots for the disks.
-
Log on to the CloudOps Orchestration Service (OOS) console.
-
In the left-side navigation pane, choose , and click Create.

-
In the Set rules area, configure File retention period, Unit, Cleanup path, and Cleanup file.
Example:
*.logfiles in/home/admin/logs/are deleted after 7 days.
Click the
icon next to a rule to add more cleanup paths and files.ImportantVerify that the cleanup paths and files are correct to avoid accidental deletion of important data.
-
Click Cleanup time to configure the execution schedule and task permissions.
-
Scheduled type: Select Periodic execution and set the Recurrence Frequency.
You can set the recurrence using preset periods or a cron expression. The following example uses a cron expression.
Example: run the cleanup task at 23:00:00 on the fifth day of each month, ending at 23:00:00 on August 31, 2026 (China/Shanghai time):

-
Permissions: Select Specify RAM Role and Use Permissions Granted to This Role (default), and select the default OOS role OOSServiceRole. See Set a RAM role for OOS and grant permissions.
-
-
Click Select Instances and select the target instances.

-
Click Advanced (Optional). Set Rate Control to Concurrency-based Control, and configure Concurrency and Error Threshold.
-
Rate Control:
-
Concurrency-based Control: Maintains the specified concurrency rate until the task completes. Use this to control resource consumption.
-
Batch-based Control: Runs the task in batches; the next batch starts after the previous one completes. Use this to control execution pace or ensure processing order.
-
-
Concurrency: The number or percentage of instances that run the task concurrently. In this example, the value is 1 (one instance at a time).
-
Error Threshold: The maximum number of allowed errors before the task stops. Accepts a number or percentage. Default value: 0 (stops on the first error). Set to 100% to ignore all errors.

-
-
Keep the defaults for Execution settings (Optional) and click Create.
-
In the Parameter Confirmation dialog box, verify the settings and click OK.
-
View the execution details.
In the task list, click Details in the Actions column.