The execute batch-file command configures batch file execution for a maintenance assistant.
The execute command command configures command execution for a maintenance assistant.
The undo execute command cancels the configuration.
By default, no task is configured for a maintenance assistant.
Parameter | Description | Value |
---|---|---|
priority |
Specifies the task priority. |
The value is in the format of integer1[.integer2] to allow an n.5 to be inserted between n and n+1. For example, if a user has configured tasks with the priorities 2 and 3 and needs to perform a task between the tasks with the priorities 2 and 3, the user can set the priority of the new task to 2.5. |
command-string |
Specifies a command. |
The value is a string of 1 to 511. |
batch-file file-name |
Specifies the name of a batch file. |
The value is a string of 5 to 56 characters. The file name extension is .bat. |
Usage Scenario
To configure a device to automatically run a large number of commands when a specific condition is met, users can enable batch file execution for a maintenance assistant in the OPS.
After a maintenance assistant is created, the assistant must be configured with tasks. Each maintenance assistant can be configured with at most one batch file with the size not greater than 1 MB. The configuration modification in the script takes effect immediately and does not require committing.
When users configure the execute command, the OPS checks whether the file name extension is .bat but does not verify the file contents.
To configure a device to automatically run a large number of commands when a specific condition is met, users can enable batch file execution for a maintenance assistant in the OPS.
Prerequisites
The assistant command has been run in the system view to create a maintenance assistant.
The ops install file command has been run to save the batch file in the /user/bat directory.
Precautions
After a maintenance assistant is created, the assistant must be configured with tasks.
For the execute batch-file command:
For the execute command command:
<HUAWEI> system-view [~HUAWEI] ops [~HUAWEI-ops] assistant task [*HUAWEI-assistant-task] execute 2 batch-file batch.bat
<HUAWEI> system-view [~HUAWEI] ops [~HUAWEI-ops] assistant reboot [*HUAWEI-ops-assistant-reboot] execute 1 command reboot