Creating a Scheduled Task
During routine O&M, you need to periodically perform maintenance operations (such as software updates and data backups) on servers. Manual operations are time-consuming and labor-intensive, and can lead to omissions or inconsistencies. To address this challenge,
With the scheduled O&M function, you can preset execution rules for target servers to automatically run scripts or O&M jobs at set times, greatly enhancing automation. Setting up scheduled tasks allows you to automate various O&M operations at specific times, minimizing manual effort while boosting efficiency and reliability.
Constraints
- Each account can create a maximum of 200 scheduled tasks.
- A maximum of 999 instances can be selected for a task.
Creating a Scheduled Task
- Log in to COC.
- In the navigation pane, choose Resource O&M > Automated O&M.
- In the Routine O&M module, click Scheduled O&M. The Scheduled O&M page is displayed.
- Click Create Task.
- Set Basic Information.
Table 1 Basic information parameters Parameter
Description
Task Name
Customize a task name based on the naming rules.
The value can contain 3 to 100 characters, including letters, digits, hyphens (-), and underscores (_).
Enterprise Project
Select an enterprise project from the drop-down list.
Version
Enter the script version number.
Risk Level
Select High, Medium, or Low based on service requirements.
- Set parameters in the Scheduled Settings area.
Table 2 Parameter description Parameter
Description
Time Zone
Select the time zone where the scheduled task is executed from the drop-down list.
Timing Type
Select a scheduled type.
- Single execution: A scheduled task is executed once at a specified time.
- Periodic execution: A task is periodically executed based on the specified rule until the rule expires.
Execution Time
It is used together with the timing type.
- For a one-time execution, set this parameter to the execution time.
- For periodic execution, select either of the following options:
- Simple: Select the execution time by week.
- Cron: Set the execution time using a cron expression. For details, see Using Cron Expressions.
Rule Expired
This parameter needs to be set when Timing Type is set to Periodic execution.
Configure the end time of the rule. The scheduled task is executed periodically based on the user-defined execution period until the rule end time.
- Select Task Type and set the task configuration based on the selected type.
- (Optional) Set global parameters.
Global parameters can be customized or obtained from the parameter center. Click Modify to modify the global parameters of the selected job. On the scheduled task page, you can only modify parameter values. To modify parameter names, go to the job management page or the parameter center.
- Set Manual Review
Table 7 Parameters for manual review Parameter
Description
Manual Review
After this function is enabled, the task needs to be reviewed. For details about how to review, see Reviewing a Scheduled Task.
Reviewer
Select Shift or Individual.- Shift: Select a shift scenario and a role from the drop-down lists based on the configured values. For details about how to configure a shift, see Shift Schedule Management.
- Individual: Select a reviewer. For details about how to configure a reviewer, see Personnel Management.
Notification Mode
Select a notification channel from the drop-down list.- Default: The notification channel selected in the subscription notification settings of the reviewer is used by default. For details about how to set the default notification channel, see Selecting a Notification Method.
- SMS, WeCom, DingTalk, Lark, and Email: Notifications are sent based on the information reserved by the reviewer. For details about how to set the reviewer information, see Modifying Personnel Information.
- No notification: The system does not notify any recipient.
- Enable Send Notification. This operation is optional.
Table 8 Notification parameters Parameter
Description
Send Notifications
Enable it and set Recipient and Notification Mode based on the selected notification policy.
Notification Policy
Select Start of execution, Execution failed, or Execution succeeded. Multiple options can be selected.
Recipient
Select Shift or Individual.- Shift: Select a shift scenario and a role from the drop-down lists based on the configured values. For details about how to configure a shift, see Shift Schedule Management.
- Individual: Select a reviewer. For details about how to configure a reviewer, see Personnel Management.
Notification Mode
- Select a notification channel from the drop-down list.
- Default: The notification channel selected in the subscription notification settings of the reviewer is used by default. For details about how to set the default notification channel, see Selecting a Notification Method.
- SMS, WeCom, DingTalk, Lark, and Email: Notifications are sent based on the information reserved by the recipient. For details about how to set recipient information, see Modifying Personnel Information.
- Click OK. The scheduled task is created.
After the scheduled task is created, you can view its information in the scheduled task list, such as the schedule type, script/job name, number of executions, and status. You can also manage scheduled tasks based on service requirements.
Wait until the task execution time arrives. The system automatically performs related operations.
Helpful Links
- When creating a scheduled task, check whether the parameters in the parameter center and those set on the target instances belong to different regions.
- To use a scheduled task to automatically restart ECSs, see Automatically Restarting an ECS at a Specified Time.
- Use COC scheduled ECS startup/shutdown to cut costs generated by idle ECSs during off-peak hours. For details, see Saving Costs Through Scheduled Startup and Shutdown on COC.
- Use COC to build a mechanism for automatically notification upon scheduled OS patch scanning failures. This mechanism enables real-time notification of failure incidents, quick root cause identification, and closed-loop issue resolution. For details, see Automatic Notification Upon Scheduled OS Patch Scanning Failures.
- COC enables you to create, enable, disable, modify, and delete scheduled tasks through API calls. For details, see Scheduled O&M.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
