Showing posts with label automation. Show all posts
Showing posts with label automation. Show all posts

How to configure command scheduler on Cisco Device


Problem: 

There is needed to be able to create scheduler to write or copy the running configuration to startup configuration on Cisco Router. Because sometimes the device suddenly crashes or a problem occurs which causes the device goes down and the Router not use the latest configuration.


Solution:

Create task scheduler using kron command.
For example we want to create scheduler to copy or write configuration from running config to startup config repeated every 5 minutes.

The configuration should be:

  1. Create kron policy
    Router(config)#kron policy-list WRITE-SCHEDULER
    Router(config-kron-policy)#cli write memory
    Router(config-kron-policy)#exit

    Notes:
    - WRITE-SCHEDULER : name of kron policy
    - cli : input exec level cli want to input in policy
    - write memory : exec command

  2. Create kron scheduler
    
    Router(config)#kron occurrence WRITE_SCHEDULER_5MIN_REC in 5 recurring
    

    Notes:
    WRITE_SCHEDULER_5MIN_REC : name of kron scheduler
    - in 5 recurring : it means the scheduler running in every 5 minutes

  3. Apply kron policies to scheduler
    
    Router(config-kron-occurrence)#policy-list WRITE-SCHEDULER
    

    Notes:
    - WRITE-SCHEDULER : name of policy created before

To make sure kron settings, you can use the exec command "show kron schedule".


Router#show kron schedule
Kron Occurrence Schedule
WRITE_SCHEDULER_5MIN_REC inactive, will run again in 0 days 00:04:12


You can create kron for the specific date and time but please don't forget to set your date and time in your router. Because the automation configuration like kron is depend on your date and time settings.


Share: