cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
13764
Views
15
Helpful
4
Comments
Nadeem Ahmed
Cisco Employee
Cisco Employee

Command Scheduler

The Command Scheduler (KRON) Policy for System Startup feature enables support for the Command Scheduler upon system startup.

The Command Scheduler allows customers to schedule fully-qualified EXEC mode CLI commands to run once, at specified intervals, at specified calendar dates and times, or upon system startup. Originally designed to work with Cisco Networking Services commands, Command Scheduler now has a broader application. Using the Cisco Networking Services image agent feature, remote devices residing outside a firewall or using Network Address Translation (NAT) addresses can use Command Scheduler to launch CLI at intervals, to update the image running in the device.

Command Scheduler has two basic processes. A policy list is configured containing lines of fully-qualified EXEC CLI commands to be run at the same time or same interval. One or more policy lists are then scheduled to run after a specified interval of time, at a specified calendar date and time, or upon system startup. Each scheduled occurrence can be set to run either once only or on a recurring basis.

How to Configure Command Scheduler (Kron) Here i explain how to reload your router every week on certain time.

First, create a kron policy list. Essentially, this policy list serves as your "script," which lists what you want the router to run at a scheduled time. Here's an example:

 

Go to global config mode

Config terminal

Router (config)# kron policy-list reload-weekly

 

Router(config-kron-policy)# cli reload ==è This “reload” what cli command you would like to execute here we are doing reload

 

Router (config-kron-policy)# exit

Next, create a kron occurrence, in which you tell the router when and how often you want to run this policy list (i.e., group of commands). Here's an example:

Router (config)# kron occurrence reload-weekly at 07:00 Mon recurring ==è Specify the date and day (if you want to do it on recurring type recurring)

 

Router(config-kron-occurrence)# policy-list reload-weekly

 

Router# show kron schedule

Kron Occurrence Schedule

Reload-weekly inactive, will run again in 6 days 10:52:57 at 7 :00 on Mon

 

By doing above configuration, you router will reload every “Monday” at 7:00 AM . You can play around with many things like saving configuration , remove files etc according to your need.

 

 

Make sure you write the configuration.

 

http://www.cisco.com/c/en/us/support/docs/ios-nx-os-software/ios-software-releases-122-mainline/46741-backup-config.html#req

http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/cns/configuration/xe-3s/asr1000/cns-xe-3s-asr1000-book/cns-cmd-sched.html#GUID-4D370148-CCCD-4668-A98E-3E719F53DA60

 Br,

Nadeem Ahmed.

Please rate if you find this useful.

Comments
Aman Soi
VIP Alumni
VIP Alumni

good DOC  for maintenance purpose.[+5]

 

regds,

aman

sunilbisht1986
Level 1
Level 1

Hi Nadeem,

Can you please help me with the command to get output for multiple show commands in a single text file like show vlan brief, show interface trunk, show ip eigrp neighbor and so on. Thanks.

m.yildiz
Level 1
Level 1

Hi

how to disable or delete the cron jobs?

thanks for help

laurence972
Level 1
Level 1

Hi,

Your doc is very helpful.

But in my router, the kron script fails because it needs a confirmation for the reload command.

How can I reload without having the confirmation request ?

Regards.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: