No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

S12700 V200R013C00 Configuration Guide - Basic Configuration

This document describes the configurations of Basic, including CLI Overview, EasyDeploy Configuration, USB-based Deployment Configuration, Logging In to a Device for the First Time, CLI Login Configuration, Web System Login Configuration, File Management, Configuring System Startup, ISSU Configuration, BootLoad Menu Operation.
Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Executing Commands in a Batch

Executing Commands in a Batch

Context

If multiple commands are frequently used consecutively, you can edit these commands to execute them in a batch. This simplifies user operation.

Two batch command execution modes are available: manual batch command execution and automatic batch command execution.
  • Manual batch command execution: The 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.
  • Automatic batch command execution: The user edits commands to be executed in batches, saves them in a batch file, uploads the batch file to the device, and configures the execution time to process the batch file. Then, the device automatically executes the commands in batches.

Procedure

  • Manual batch command execution

    1. Run the batch-cmd edit command in the user view to edit commands to be executed in a batch.

      After commands are edited, press Enter to complete the editing of each command. Enter another command in the next line.

      NOTE:
      • After the batch-cmd edit command is run successfully to edit the commands to be executed in a batch, the system deletes the original commands to be run in a batch.

      • The commands that are already edited are saved in memory and are deleted forever when the system is restarted.

    2. After all commands are edited, press Ctrl+Z or input batch-cmd-end to exit the edit state and return to the user view.

    3. Run the batch-cmd execute [ output file-name | background ] * command in the user view to execute the commands in a batch.

      The commands are executed in the same sequence as they are edited. You can view the execution of these commands on the CLI. After command execution is complete, the user view is displayed.

      Without entering output file-name, you can view the execution of these commands on the CLI. After the execution is complete, the user view is displayed. If you enter output file-name, the command output is saved to the specified file, and the command execution cannot be viewed in the CLI.

      After you enter background, the commands are executed in the background when the terminal connection is torn down.

      NOTE:
      • The device saves only one copy of the commands to be executed in a batch. If a command is edited for a second time, the new one overwrites the original one. The system allows only one user to run the batch-cmd edit and batch-cmd execute commands at a time.
      • The commands that are already edited are saved in the memory and are deleted permanently together with the memory information when the system restarts.

      • If the batch-cmd edit or batch-cmd execute command is among the commands to be executed in a batch, the system displays an error when executing the batch-cmd edit or batch-cmd execute command and continues to execute the following commands.

    4. (Optional) Run the batch-cmd execute stop command in the user view to stop the batch command execution.

      If some commands no longer need to be executed in a batch, for example, another user attempts to execute the commands in a batch or the connection is torn down, run the batch-cmd execute stop command to stop the execution of these commands. The commands that have been successfully executed are still valid.

  • Automatic batch command execution

    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. Before configuring automatic batch command execution, edit the batch file on the PC and 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.

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

    2. Run the assistant task task-name command to create an assistant task. You can create a maximum of five assistant tasks.

    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.

Translation
Download
Updated: 2019-04-08

Document ID: EDOC1100065643

Views: 10733

Downloads: 33

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next