- Read Me First
- Configuring Cisco Networking Services
- CNS Configuration Agent
- Cisco Networking Services Config Retrieve Enhancement with Retry and Interval
- Cisco Networking Services Interactive CLI
- Command Scheduler (Kron)
- Network Configuration Protocol
- NETCONF over SSHv2
- NETCONF Access for Configurations over BEEP
Command Scheduler (Kron)
- Finding Feature Information
- Restrictions for Command Scheduler
- Information About Command Scheduler (Kron)
- How to Configure Command Scheduler (Kron)
- Configuration Examples for Command Scheduler (Kron)
- Additional References
- Feature Information for Command Scheduler (Kron)
Finding Feature Information
Your software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table at the end of this module.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Restrictions for Command Scheduler
The EXEC CLI specified in a Command Scheduler policy list must neither generate a prompt nor can it be terminated using keystrokes. Command Scheduler is designed as a fully automated facility, and no manual intervention is permitted.
Information About Command Scheduler (Kron)
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)
Configuring Command Scheduler Policy Lists and Occurrences
An occurrence for Command Scheduler is defined as a scheduled event. Policy lists are configured to run after a specified interval of time, at a specified calendar date and time, or upon system startup. Policy lists can be run once, as a one-time event, or as recurring events over time.
Command Scheduler occurrences can be scheduled before the associated policy list has been configured, but a warning will advise you to configure the policy list before it is scheduled to run.
Perform this task to set up Command Scheduler policy lists of EXEC Cisco Networking Services commands and configure a Command Scheduler occurrence to specify the time or interval after which the Cisco Networking Services commands will run.
Command Scheduler Policy Lists
Policy lists consist of one or more lines of fully-qualified EXEC CLI commands. All commands in a policy list are executed when the policy list is run by Command Scheduler using the kron occurrence command. Use separate policy lists for CLI commands that are run at different times. No editor function is available, and the policy list is run in the order in which it was configured. To delete an entry, use the no form of the cli command followed by the appropriate EXEC command. If an existing policy list name is used, new entries are added to the end of the policy list. To view entries in a policy list, use the show running-config command. If a policy list is scheduled to run only once, it will not be displayed by the show running-config command after it has run.
Policy lists can be configured after the policy list has been scheduled, but each policy list must be configured before it is scheduled to run.
Command Scheduler Occurences
The clock time must be set on the routing device before a Command Scheduler occurrence is scheduled to run. If the clock time is not set, a warning message will appear on the console screen after the kron occurrence command has been entered. Use the clock command or Network Time Protocol (NTP) to set the clock time.
The EXEC CLI to be run by Command Scheduler must be tested on the routing device to determine if it will run without generating a prompt or allowing execution interruption by keystrokes. Initial testing is important because Command Scheduler will delete the entire policy list if any CLI syntax fails. Removing the policy list ensures that any CLI dependencies will not generate more errors.
If you use the conditional keyword with the kron policy-list command, execution of the commands will stop when an error is encountered.
Note |
1.
enable
2.
configure
terminal
3.
kron
policy-list
list-name
[conditional]
4.
cli
command
5.
exit
6.
kron
occurrence
occurrence-name
[user
username] {in[[numdays:]numhours:]nummin|
at
hours:min[[month]
day-of-month] [day-of-week]} {oneshot|
recurring|
system-startup}
7.
policy-list
list-name
8.
exit
9.
show
kron
schedule
DETAILED STEPS
Examples
In the following example, output information is displayed about the status and schedule of all configured Command Scheduler occurrences:
Device# show kron schedule Kron Occurrence Schedule cns-weekly inactive, will run again in 7 days 01:02:33 may inactive, will run once in 32 days 20:43:31 at 6:30 on May 20
Troubleshooting Tips
Use the debug kron command in privileged EXEC mode to troubleshoot Command Scheduler command operations. Use any debugging command with caution because the volume of output generated can slow or stop the device's operations.
Configuration Examples for Command Scheduler (Kron)
Example: Command Scheduler Policy Lists and Occurrences
In the following example, a Command Scheduler policy named cns-weekly is configured to run two sets of EXEC CLI involving Cisco Networking Services commands. The policy is then scheduled with two other policies to run every seven days, one hour and thirty minutes.
kron policy-list cns-weekly cli cns image retrieve server http://10.19.2.3/week/ status http://10.19.2.5/status/week/ cli cns config retrieve page /testconfig/config.asp no-persist exit kron occurrence week in 7:1:30 recurring policy-list cns-weekly policy-list itd-weekly policy-list mkt-weekly
In the following example, a Command Scheduler policy named sales-may is configured to run a Cisco Networking Services command to retrieve a specified image from a remote server. The policy is then scheduled to run only once on May 20, at 6:30 a.m.
kron policy-list sales-may cli cns image retrieve server 10.19.2.3 status 10.19.2.3 exit kron occurrence may at 6:30 May 20 oneshot policy-list sales-may
In the following example, a Command Scheduler policy named image-sunday is configured to run a Cisco Networking Services command to retrieve a specified image from a remote server. The policy is then scheduled to run every Sunday at 7:30 a.m.
kron policy-list image-sunday cli cns image retrieve server 10.19.2.3 status 10.19.2.3 exit kron occurrence sunday user sales at 7:30 sunday recurring policy-list image-sunday
In the following example, a Command Scheduler policy named file-retrieval is configured to run a Cisco Networking Services command to retrieve a specific file from a remote server. The policy is then scheduled to run on system startup.
kron policy-list file-retrieval cli cns image retrieve server 10.19.2.3 status 10.19.2.3 exit kron occurrence system-startup policy-list file-retrieval
Additional References
Related Documents
Related Topic |
Document Title |
---|---|
Cisco IOS commands |
|
Cisco Networking Services commands: complete command syntax, command mode, command history, defaults, usage guidelines, and examples. |
|
Cisco Networking Services Configuration Engine |
Standards and RFCs
Standard/RFC |
Title |
---|---|
No new or modified standards/RFCs are supported by this feature, and support for existing standards/RFCs has not been modified by this feature. |
-- |
MIBs
MIB |
MIBs Link |
---|---|
No new or modified MIBs are supported by this feature, and support for existing MIBs has not been modified by this feature. |
To locate and download MIBs for selected platforms, Cisco software releases, and feature sets, use Cisco MIB Locator found at the following URL: |
Technical Assistance
Description |
Link |
---|---|
The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password. |
Feature Information for Command Scheduler (Kron)
The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.Feature Name |
Releases |
Feature Information |
---|---|---|
Command Scheduler (Kron) |
Cisco IOS XE Release 2.1 12.3(1) 12.2(33)SRA 12.2(33)SRC 12.2(33)SB 12.2(33)SXI 12.2(50)SY |
The Command Scheduler feature provides the ability to schedule some EXEC CLI commands to run at specific times or at specified intervals. The following commands were introduced or modified by this feature: cli, debug kron, kron occurrence, kron policy-list, policy-list, show kron schedule. |
Command Scheduler (Kron) Policy for System Startup |
12.2(33)SRC 12.2(50)SY 12.2(33)SB 12.4(15)T |
The Command Scheduler (Kron) Policy for System Startup feature enables support for the Command Scheduler feature upon system startup. |