< Home

Executing Commands in a Batch

Context

Manual mode batch command execution is available. A user edits commands to be executed in batches and saves the commands in the device memory. When the user performs batch command execution, the device reads the commands from the memory, executes them one by one, and returns the execution result.

Assistant tasks help implement automatic batch command execution. You can create a maximum of five assistant tasks on the device and each assistant task is bound with a batch file. After an execution time is configured, the device automatically executes commands in the batch file one by one. Automatic batch command execution is frequently used for periodic system upgrade or configuration.

A batch file is a collection of executable commands and the file is in the format of *.bat. When the batch file is processed, commands in the file are executed one by one.

Pre-configuration Tasks

Before configuring automatic batch command execution, perform the following tasks:

  • Edit the batch file on the PC.
  • Upload the batch file to the device.

If the file name extension is not .bat, change it to .bat before you upload the batch file to the device. Alternatively, upload the batch file to the device and then run the rename command to change the file name extension.

Procedure

  1. Run the system-view command to enter the system view.

  2. Run the assistant task task-name command to create an assistant task.

  3. Run the if-match timer cron seconds minutes hours days-of-month months days-of-week [ years ] command to specify the time for performing assistant tasks.
  4. Run the perform priority batch-file filename command to bind the batch file with the assistant task.

  5. Run the display assistant task history [ task-name ] command to check the operation records of assistant tasks.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >