- Preface
- New and Changed Information for this Release
- Overview
- Configuring User Accounts and RBAC
- Configuring Session Manager
- Configuring the Scheduler
- Configuring Online Diagnostics
- Configuring NTP
- Configuring System Message Logging
- Configuring Smart Call Home
- Configuring DNS
- Configuring SNMP
- Configuring RMON
- Configuring SPAN
- Configuring Warp SPAN
- Configuring Active Buffer Monitoring
- Configuring Warp Mode
- Index
Configuring the Scheduler
This chapter contains the following sections:
- Information About the Scheduler
- Licensing Requirements for the Scheduler
- Guidelines and Limitations for the Scheduler
- Default Settings for the Scheduler
- Configuring the Scheduler
- Verifying the Scheduler Configuration
- Configuration Examples for the Scheduler
- Standards for the Scheduler
Information About the Scheduler
The scheduler allows you to define and set a timetable for maintenance activities such as the following:
Jobs consist of a single command or multiple commands that define routine activities. Jobs can be scheduled one time or at periodic intervals.
The scheduler defines a job and its timetable as follows:
- Job
-
A routine task or tasks defined as a command list and completed according to a specified schedule.
- Schedule
-
The timetable for completing a job. You can assign multiple jobs to a schedule.
A schedule is defined as either periodic or one-time only:
Remote User Authentication
Before starting a job, the scheduler authenticates the user who created the job. Because user credentials from a remote authentication are not retained long enough to support a scheduled job, you must locally configure the authentication passwords for users who create jobs. These passwords are part of the scheduler configuration and are not considered a locally configured user.
Before starting the job, the scheduler validates the local password against the password from the remote authentication server.
Scheduler Log Files
The scheduler maintains a log file that contains the job output. If the size of the job output is greater than the size of the log file, the output is truncated.
Licensing Requirements for the Scheduler
This feature does not require a license. Any feature not included in a license package is bundled with the Cisco NX-OS system images and is provided at no extra charge to you. For a complete explanation of the Cisco NX-OS licensing scheme, see the Cisco NX-OS Licensing Guide.
Guidelines and Limitations for the Scheduler
- The scheduler can fail if it encounters one of the following while performing a job:
- Verify that you have configured the time. The scheduler does not apply a default timetable. If you create a schedule, assign jobs, and do not configure the time, the job is not started.
- While defining a job, verify that no interactive or disruptive commands (for example, copy bootflash: file ftp:URI, write erase, and other similar commands) are specified because the job is started and conducted noninteractively.
Default Settings for the Scheduler
| Parameters | Default |
|---|---|
Scheduler state |
Disabled |
Log file size |
16 KB |
Configuring the Scheduler
Enabling the Scheduler
This example shows how to enable the scheduler:
switch# configure terminal switch(config)# feature scheduler switch(config)# show scheduler config config terminal feature scheduler scheduler logfile size 16 end switch(config)#
Defining the Scheduler Log File Size
This example shows how to define the scheduler log file size:
switch# configure terminal switch(config)# scheduler logfile size 1024 switch(config)#
Configuring Remote User Authentication
Remote users must authenticate with their clear text password before creating and configuring jobs.
Remote user passwords are always shown in encrypted form in the output of the show running-config command. The encrypted option (7) in the command supports the ASCII device configuration.
| Command or Action | Purpose | |
|---|---|---|
| Step 1 | switch# configure terminal | Enters global configuration mode. |
| Step 2 | switch(config) # scheduler aaa-authentication password [0 | 7] password | Configures a password for the user who is currently logged in. To configure a clear text password, enter 0. To configure an encrypted password, enter 7. |
| Step 3 | switch(config) # scheduler aaa-authentication username name password [0 | 7] password | Configures a clear text password for a remote user. |
| Step 4 | switch(config) # show running-config | include "scheduler aaa-authentication" | (Optional) Displays the scheduler password information. |
| Step 5 | switch(config)# copy running-config startup-config | (Optional) Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration. |
This example shows how to configure a clear text password for a remote user called NewUser:
switch# configure terminal switch(config) # scheduler aaa-authentication username NewUser password z98y76x54b switch(config) # copy running-config startup-config switch(config) #
Defining a Job
Once a job is defined, you cannot modify or remove a command. To change the job, you must delete it and create a new one.
| Command or Action | Purpose | |
|---|---|---|
| Step 1 | switch# configure terminal | Enters global configuration mode. |
| Step 2 | switch(config) # scheduler job name name | Creates a job with the specified name and enters job configuration mode. The name is restricted to 31 characters. |
| Step 3 | switch(config-job) # command1 ; [command2 ;command3 ; ... | Defines the sequence of commands for the specified job. You must separate commands with a space and a semicolon ( ;). The filename is created using the current time stamp and switch name. |
| Step 4 | switch(config-job) # show scheduler job [name] | (Optional) Displays the job information. The name is restricted to 31 characters. |
| Step 5 | switch(config-job) # copy running-config startup-config | (Optional) Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration. |
This example shows how to create a scheduler job named backup-cfg, save the running configuration to a file in bootflash, copy the file from bootflash to a TFTP server, and save the change to the startup configuration:
switch# configure terminal switch(config) # scheduler job name backup-cfg switch(config-job) # cli var name timestamp $(timestamp) ;copy running-config bootflash:/$(SWITCHNAME)-cfg.$(timestamp) ;copy bootflash:/$(SWITCHNAME)-cfg.$(timestamp) tftp://1.2.3.4/ vrf management switch(config-job) # copy running-config startup-config
Deleting a Job
| Command or Action | Purpose | |
|---|---|---|
| Step 1 | switch# configure terminal | Enters global configuration mode. |
| Step 2 | switch(config) # no scheduler job name name | Deletes the specified job and all commands defined within it. The name is restricted to 31 characters. |
| Step 3 | switch(config-job) # show scheduler job [name] | (Optional) Displays the job information. |
| Step 4 | switch(config-job) # copy running-config startup-config | (Optional) Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration. |
This example shows how to delete a job called configsave:
switch# configure terminal switch(config)# no scheduler job name configsave switch(config-job)# copy running-config startup-config switch(config-job)#
Defining a Timetable
You must configure a timetable. Otherwise, jobs will not be scheduled.
If you do not specify the time for the time commands, the scheduler assumes the current time. For example, if the current time is March 24, 2008, 22:00 hours,jobs are started as follows:
- For the time start 23:00 repeat 4:00:00 command, the scheduler assumes a start time of March 24, 2008, 23:00 hours.
- For the time daily 55 command, the scheduler assumes a start time every day at 22:55 hours.
- For the time weekly 23:00 command, the scheduler assumes a start time every Friday at 23:00 hours.
- For the time monthly 23:00 command, the scheduler assumes a start time on the 24th of every month at 23:00 hours.
![]() Note |
The scheduler will not begin the next occurrence of a job before the last one completes. For example, you have scheduled a job to be completed at one-minute intervals beginning at 22:00; but the job requires two minutes to complete. The scheduler starts the first job at 22:00, completes it at 22:02, and then observes a one-minute interval before starting the next job at 22:03. |
| Command or Action | Purpose | |
|---|---|---|
| Step 1 | switch# configure terminal | Enters global configuration mode. |
| Step 2 | switch(config) # scheduler schedule name name | Creates a new scheduler and enters schedule configuration mode for that schedule. The name is restricted to 31 characters. |
| Step 3 | switch(config-schedule) # job name name | Associates a job with this schedule. You can add multiple jobs to a schedule. The name is restricted to 31 characters. |
| Step 4 | switch(config-schedule) # time daily time | Indicates the job starts every day at a designated time, specified as HH:MM. |
| Step 5 | switch(config-schedule) # time weekly [[day-of-week:] HH:] MM | Indicates that the job starts on a specified day of the week. The day of the week is represented by an integer (for example, 1 for Sunday, 2 for Monday) or as an abbreviation (for example, sun, mon). The maximum length for the entire argument is 10 characters. |
| Step 6 | switch(config-schedule) # time monthly [[day-of-month:] HH:] MM | Indicates that the job starts on a specified day each month. If you specify 29, 30, or 31, the job is started on the last day of each month. |
| Step 7 | switch(config-schedule) # time start {now repeat repeat-interval | delta-time [repeat repeat-interval]} | Indicates the job starts periodically. The start-time format is [[[[yyyy:]mmm:]dd:]HH]:MM. |
| Step 8 | switch(config-schedule) # show scheduler config | (Optional) Displays the scheduler information. |
| Step 9 | switch(config-schedule) # copy running-config startup-config | (Optional) Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration. |
This example shows how to define a timetable where jobs start on the 28th of each month at 23:00 hours:
switch# configure terminal switch(config)# scheduler schedule name weekendbackupqos switch(config-scheduler)# job name offpeakzoning switch(config-scheduler)# time monthly 28:23:00 switch(config-scheduler)# copy running-config startup-config switch(config-scheduler)#
Clearing the Scheduler Log File
| Command or Action | Purpose | |
|---|---|---|
| Step 1 | switch# configure terminal | Enters global configuration mode. |
| Step 2 | switch(config) # clear scheduler logfile | Clears the scheduler log file. |
This example shows how to clear the scheduler log file:
switch# configure terminal switch(config)# clear scheduler logfile
Disabling the Scheduler
| Command or Action | Purpose | |
|---|---|---|
| Step 1 | switch# configure terminal | Enters global configuration mode. |
| Step 2 | switch(config) # no feature scheduler | Disables the scheduler. |
| Step 3 | switch(config) # show scheduler config | (Optional) Displays the scheduler configuration. |
| Step 4 | switch(config)# copy running-config startup-config | (Optional) Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration. |
This example shows how to disable the scheduler:
switch# configure terminal switch(config) # no feature scheduler switch(config) # copy running-config startup-config switch(config) #
Verifying the Scheduler Configuration
Use one of the following commands to verify the configuration:
| Command | Purpose |
|---|---|
| show scheduler config | Displays the scheduler configuration. |
| show scheduler job [name name] | Displays the jobs configured. |
| show scheduler logfile | Displays the contents of the scheduler log file. |
| show scheduler schedule [name name] | Displays the schedules configured. |
Configuration Examples for the Scheduler
Creating a Scheduler Job
This example shows how to create a scheduler job that saves the running configuration to a file in bootflash and then copies the file from bootflash to a TFTP server (the filename is created using the current time stamp and switch name):
switch# configure terminal switch(config)# scheduler job name backup-cfg switch(config-job)# cli var name timestamp $(TIMESTAMP) ;copy running-config bootflash:/$(SWITCHNAME)-cfg.$(timestamp) ;copy bootflash:/$(SWITCHNAME)-cfg.$(timestamp) tftp://1.2.3.4/ vrf management switch(config-job)# end switch(config)#
Scheduling a Scheduler Job
This example shows how to schedule a scheduler job called backup-cfg to run daily at 1 a.m.:
switch# configure terminal switch(config)# scheduler schedule name daily switch(config-schedule)# job name backup-cfg switch(config-schedule)# time daily 1:00 switch(config-schedule)# end switch(config)#
Displaying the Job Schedule
This example shows how to display the job schedule:
switch# show scheduler schedule
Schedule Name : daily
---------------------------
User Name : admin
Schedule Type : Run every day at 1 Hrs 00 Mins
Last Execution Time : Fri Jan 2 1:00:00 2009
Last Completion Time: Fri Jan 2 1:00:01 2009
Execution count : 2
-----------------------------------------------
Job Name Last Execution Status
-----------------------------------------------
back-cfg Success (0)
switch(config)#
Displaying the Results of Running Scheduler Jobs
This example shows how to display the results of scheduler jobs that have been executed by the scheduler:
switch# show scheduler logfile Job Name : back-cfg Job Status: Failed (1) Schedule Name : daily User Name : admin Completion time: Fri Jan 1 1:00:01 2009 --------------------------------- Job Output --------------------------------- `cli var name timestamp 2009-01-01-01.00.00` `copy running-config bootflash:/$(HOSTNAME)-cfg.$(timestamp)` `copy bootflash:/switch-cfg.2009-01-01-01.00.00 tftp://1.2.3.4/ vrf management ` copy: cannot access file '/bootflash/switch-cfg.2009-01-01-01.00.00' ============================================================================== Job Name : back-cfg Job Status: Success (0) Schedule Name : daily User Name : admin Completion time: Fri Jan 2 1:00:01 2009 --------------------------------- Job Output --------------------------------- `cli var name timestamp 2009-01-02-01.00.00` `copy running-config bootflash:/switch-cfg.2009-01-02-01.00.00` `copy bootflash:/switch-cfg.2009--01-02-01.00.00 tftp://1.2.3.4/ vrf management ` Connection to Server Established. [ ] 0.50KBTrying to connect to tftp server...... [###### ] 24.50KB TFTP put operation was successful ============================================================================== switch#
Standards for the Scheduler
No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.

Feedback