Rolling back to a stable configuration using job scheduler

Procedure
  1. Configure the job using alias with the required configuration.
    alias <name> <command-list>
    job <name> delay [[DD:]HH:]MM <command>
    To schedule a job execution with cfg-restore operation once after 15 minutes (00:00:15):
    alias "cfg_rollback" "cfg-restore flash stable"
    job "cfg_stable" delay 00:00:15 "cfg_rollback" count 1
    
  2. Back up the current stable configuration using the command cfg-backup running-config config <config_name>.
    cfg-backup running-config config stable
  3. Check the backup configuration using the command show config files.
    switch(config)# show config files
    
    Configuration files:
    
    id | act pri sec | name
    ---+-------------+-------
    1  |  *   *   *  | config
    2  |             | stable
    3  |             |
    4  |             |
    5  |             |
    
  4. Edit the configuration as needed. If the user is still connected to the switch, the configuration is stable and the job which reloads the older configuration can be cancelled using the command no job cfg_stable.

    switch(config)# no job cfg_stable

  5. If the user loses connectivity after applying the new configuration, the job scheduler executes the job after the 15-minute timer expires, and "stable" configuration is restored. Use the following commands to check the output:
    • switch(config)# show job cfg_stable

    • switch(config)# show cfg-restore status

    switch(config)# show job cfg_stable
    
     Job Information
    
      Job Name       : cfg_stable
      Runs At        : Every 00:00:15 days:hours:minutes
      Config Save    : No
      Repeat Count   : 1
      Job Status     : Enabled
      Running Status : Active
      Run Count      : 0
      Error Count    : 0
      Skip Count     : 0
      Command        : cfg_rollback
    
    switch(config)# show cfg-restore status
     Status                 : Success
     Config File Name       : stable
     Source                 : Flash
     Time Taken             : 9 Seconds
     Last Run               : Tue Nov 28 20:50:00 2017
    
     Recovery Mode          : Enabled
     Failure Reason         : -
    
     Number of Add Commands    : 27
     Number of Remove Commands : 0
    
     Time Taken for Each Phase :
          Calculating diff     : 4 Seconds
          Adding commands      : 1 Seconds
          Removing commands    : 0 Seconds
    NOTE:

    If the configuration involves any sensitive information, backup and restore the configuration by enabling the include-credentials command.