Automatic execution of commands in batches

The batch and execute functionality provides two separate but mutually inclusive features that help to automate execution of a group of CLI commands in batches at a scheduled time, count, and interval.

The batch process allows you to create and save a group of CLI commands per batch ID using the batch buffer command from global configuration mode. The commands added in the batch are saved in the running configuration. The commands that are present at the user EXEC mode, privileged EXEC mode, global configuration mode, and sub-level commands can be added to a batch.

The commands that are saved in the batch buffer are applied on the device only if the execute batch command is issued from the privileged EXEC mode. If any of the commands in a batch is invalid or fails, an error is displayed and the other commands in the batch continue to run as per the schedule. The automatic execution of commands in batches helps to collect logs for a defined period.

The execution of command batches can be scheduled in the following ways:

  • Now: Runs the commands in a batch immediately. You can also specify the count, interval, or a date and time until which the commands must run. If the interval is not set, the commands will run at the default interval of 30 minutes.
  • After: Schedules to run the commands in a batch after a specific duration.
  • At: Schedules to run the commands in a batch at a specific time.
  • Begin: Schedules to run the commands in a batch starting from the specified start-date. If the count, interval, and end-date are not specified, the commands will run infinitely at the default interval of 30 minutes. You can also specify the count, interval, or a date and time until which the commands must run.