Table Of Contents
Scheduling Maintenance Jobs
Information About the Command Scheduler
Command Scheduler Overview
Remote User Authentication
Execution Logs
High Availability
Virtualization Support
Licensing Requirements for the Command Scheduler
Prerequisites for the Command Scheduler
Configuration Guidelines and Limitations
Configuring the Command Scheduler
Enabling the Command Scheduler
Configuring Remote User Authentication
Defining a Job
Deleting a Job
Specifying a Schedule
Configuring Execution Logs
Verifying the Command Scheduler Configuration
Default Settings
Additional References
Related Documents
Standards
Scheduling Maintenance Jobs
This chapter describes how to configure the Cisco NX-OS command scheduler on a device.
This chapter includes the following sections:
•
Information About the Command Scheduler
•
Licensing Requirements for the Command Scheduler
•
Prerequisites for the Command Scheduler
•
Configuring the Command Scheduler
•
Verifying the Command Scheduler Configuration
•
Default Settings
•
Additional References
Information About the Command Scheduler
The Cisco NX-OS command scheduler allows you to schedule a job (set of CLI commands) or multiple jobs at a specified time in the future. The job(s) can be executed once at a specified time in the future or at periodic intervals.
You can use this feature to schedule Quality of Service policy changes, backup data, save the configuration or perform other similar jobs.
This section includes the following topics:
•
Command Scheduler Overview
•
Remote User Authentication
•
Execution Logs
•
High Availability
•
Virtualization Support
Command Scheduler Overview
The command scheduler consists of the following parts:
•
Job—A set of Cisco NX-OS CLI commands (EXEC and config mode) that are executed as defined in the schedule.
•
Schedule—The time when the assigned jobs execute. You can assign multiple jobs to a schedule.
A schedule executes in one of the following modes:
•
Periodic mode—A recurring interval that the job executes in until you delete the job. You can configure the following types of periodic intervals:
–
Daily—Cisco NX-OS executes the job once a day.
–
Weekly—Cisco NX-OS executes the job once a week.
–
Monthly—Cisco NX-OS executes the job once a month.
–
Delta—Cisco NX-OS executes the job beginning at the specified start time and thereafter at user-specified intervals (days:hours:minutes).
•
One-time mode—Cisco NX-OS executes the job once at a user-specified time.
Remote User Authentication
The command scheduler authenticates the user who created the job before running the scheduled job. Cisco NX-OS supports locally configured authentication and remote authentication using an authentication server. Cisco NX-OS holds the user credentials from a remote authentication for a short period of time. This time period is not long enough to support a scheduled job. You need to locally configure the authentication password for any users that create jobs. These passwords are part of the command scheduler configuration and are not considered a locally configured user.
Before the scheduled job executes, the command scheduler validates the local password against the password returned from the remote authentication server.
Execution Logs
The command scheduler maintains a log file. This log file contains the output of the job executed. If the output of the job is greater than the log file, then the output stored in this file is truncated.
High Availability
Scheduled jobs remain available after a supervisor switchover or a software reload.
Virtualization Support
Cisco NX-OS creates a scheduler job in the virtual device context (VDCs) that you are logged into. By default, Cisco NX-OS places you in the default VDC. See the Cisco Nexus 7000 Series NX-OS Virtual Device Context Configuration Guide, Release 4.0.
Licensing Requirements for the Command Scheduler
The following table shows the licensing requirements for this feature:
Product
|
License Requirement
|
NX-OS
|
Command scheduler requires no 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 NX-OS licensing scheme, see the Cisco Nexus 7000 Series NX-OS Licensing Guide, Release 4.0.
|
Prerequisites for the Command Scheduler
The command scheduler has the following prerequisites:
•
You must enable any conditional features before you can configure those features in a job.
•
You must have a valid license installed for any licensed features that you want to configure in the job.
•
You must have network-admin or vdc-admin user privileges to configure a scheduled job.
Configuration Guidelines and Limitations
The command scheduler has the following configuration guidelines and limitations:
•
The scheduled job can fail if it encounters one of the following situations when executing the job:
–
If the license has expired for a feature at the time when a job that contains commands pertaining to that feature is scheduled.
–
If a feature is disabled at the time when a job that contains commands pertaining to that feature is scheduled.
–
If you have removed a module from a slot and the job has commands that pertain to the interfaces for that module or slot.
•
Verify that you have configured the time. The scheduler does not have any default time configured. If you create a schedule and assign job(s) and do not configure the time, that schedule is not launched.
•
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 as part of a job because the job is executed noninteractively at the scheduled time.
Configuring the Command Scheduler
To configure the command scheduler, follow these steps:
Step 1
Enable the scheduler (see the "Enabling the Command Scheduler" section).
Step 2
(Optional) Authorize remote user access (optional) (see the "Configuring Remote User Authentication" section).
Step 3
Define the job (see the "Defining a Job" section).
Step 4
Specify the schedule (see the "Specifying a Schedule" section).
Step 5
Verify the scheduled configuration (see the "Verifying the Command Scheduler Configuration" section).
This section includes the following topics:
•
Enabling the Command Scheduler
•
Configuring Remote User Authentication
•
Defining a Job
•
Specifying a Schedule
Enabling the Command Scheduler
You must enable the command schedule feature before you can configure and schedule any jobs.
BEFORE YOU BEGIN
Ensure that you are in the correct VDC (or use the switchto vdc command).
DETAILED STEPS
To enable the command scheduler, use the following command in global configuration mode:
Command
|
Purpose
|
feature scheduler
Example:
switch(config)# feature scheduler
|
Enables the command scheduler in a VDC.
|
To disable the command scheduler feature in a VDC, use the following command in global configuration mode:
Command
|
Purpose
|
no feature scheduler
Example:
switch(config)# no feature scheduler
|
Disables the command scheduler. feature in a VDC.
|
Configuring Remote User Authentication
You can configure the command scheduler to use remote authentication for users who want to configure and schedule jobs.
Note
AAA authentication requires the clear text password of the remote user before creating and configuring command scheduler jobs.
BEFORE YOU BEGIN
Ensure that you are in the correct VDC (or use the switchto vdc command).
SUMMARY STEPS
1.
config t
2.
scheduler aaa-authentication password [0 | 7] password
3.
scheduler aaa-authentication username name password [0 | 7] password
4.
show running-config | include "scheduler aaa-authentication"
5.
copy running-config startup-config
DETAILED STEPS
:
| |
Command or Action
|
Purpose
|
Step 1
|
config t
Example:
switch# config t
switch(config)#
|
Enters configuration mode.
|
Step 2
|
scheduler aaa-authentication password [0 |
7] password
Example:
switch(config)# scheduler
aaa-authentication password X12y34Z56a
|
Configures a clear text password for the currently- logged in user.
|
Step 3
|
scheduler aaa-authentication username name
password [0 | 7] password
Example:
switch(config)# scheduler
aaa-authentication username newuser
password Z98y76X54b
|
Configures a clear text password for a remote user.
|
Step 4
|
show running-config | include "scheduler
aaa-authentication"
Example:
switch(config)# show running-config |
include "scheduler aaa-authentication"
|
(Optional) Displays the scheduler password information.
|
Step 5
|
copy running-config startup-config
Example:
switch(config)# copy running-config
startup-config
|
(Optional) Saves this configuration change.
|

Note
The scheduler remote user passwords are always displayed in encrypted form in the show running-config command output. The encrypted option (7) in the command exists to support applying the ASCII configuration to the device.
Defining a Job
You can use the command scheduler to define a job. You must specify the job name and define the sequence of CLI commands that the job has to perform.
Caution 
You cannot modify or remove a command after entering the sequence of commands. To make changes, you must explicitly delete the defined job name and restart this process.
BEFORE YOU BEGIN
Ensure that you are in the correct VDC (or use the switchto vdc command).
SUMMARY STEPS
1.
config t
2.
scheduler job name string
3.
command1; [command2;command2;...]
4.
exit
5.
show scheduler job [name]
6.
copy running-config startup-config
DETAILED STEPS
| |
Command
|
Purpose
|
Step 1
|
config t
Example:
switch# config t
switch(config)#
|
Enters configuration mode.
|
Step 2
|
scheduler job name string
Example:
switch(config)# scheduler job name bringup
switch(config-job)
|
Creates a job and enters the job configuration mode.
|
Step 3
|
command1; [command2;command2;...]
Example:
switch(config-job)# config t;interface
ethernet 2/1;no shutdown;show interface
ethernet 2/1
switch(config-job)# exit
switch(config)#
|
Specifies a sequence of actions for the specified job. You must separate each command with a semicolon.
|
Step 4
|
exit
Example:
switch(config-job)# exit
switch(config)#
|
Exits the job configuration mode and saves the job.
|
Step 5
|
show scheduler job [name]
Example:
switch(config)# show scheduler job
|
(Optional) Displays the job information.
|
Step 6
|
copy running-config startup-config
Example:
switch(config)# copy running-config
startup-config
|
(Optional) Saves this configuration change.
|
Deleting a Job
To delete a job, use the following command in global configuration mode:
Command
|
Purpose
|
no scheduler job name string
Example:
switch(config)# no scheduler job
name bringup
|
Deletes a defined job and all commands defined within that job.
|
Specifying a Schedule
After defining jobs, you can create schedules and assign jobs to the schedule. Subsequently, you can configure the time of execution. The execution can be one-time or periodic depending on your requirements. If the time for the schedule is not configured, then it will never be executed.
BEFORE YOU BEGIN
Ensure that you are in the correct VDC (or use the switchto vdc command).
SUMMARY STEPS
1.
config t
2.
scheduler schedule name string
3.
job name strings
4.
time daily time
time weekly [[dow:]HH:]MM
time monthly [[dow:] HH: ] MM
time start {now | start-time | delta-time} [repeat]
5.
exit
6.
show scheduler schedule [name]
7.
copy running-config startup-config
DETAILED STEPS
| |
Command or Action
|
Purpose
|
Step 1
|
config t
Example:
switch# config t
switch(config)#
|
Enters configuration mode.
|
Step 2
|
scheduler schedule name string
Example:
switch(config)# scheduler schedule
name weekendbackupqos
switch(config-schedule)#
|
Creates a schedule and enters the schedule configuration mode.
|
Step 3
|
job name string
Example:
switch(config-schedule)# job name
offpeakZoning
|
Adds a job to this schedule. You can add multiple jobs to a schedule.
|
Step 4
|
time daily time
Example:
switch(config-schedule)# time daily
23:00
|
Executes the specified jobs every day at the configured time. The time argument is specified in HH:MM format.
|
time weekly [[dow:]HH:]MM
Example:
switch(config-schedule)# time weekly
Sun:23:00
|
Specifies a weekly execution. The dow argument can be specified as:
• an integer representation of the days of the week. 1 represents Sunday, 2 represents Monday, and so on.
• An abbreviation of the day. Sun represents Sunday, for example.
The maximum length for the entire argument is 10.
|
time monthly [[dm:]HH:]MM
Example:
switch(config-schedule)# time
monthly 28:23:00
|
Specifies a monthly execution. The dm argument is an integer representation of the day of the month. If you specify the dm as either 29, 30, or 31, the command is automatically executed on the last day of each month.
|
time start {now | start-time |
delta-time} [repeat]
repeat interval
Example:
switch(config-schedule)# time start
now repeat 48:00
|
Specifies the start time for a job and when it repeats periodically.
The start-time format is [[[[yyyy:]mmm:]dd:]HH]:MM.
The delta-time specifies how soon after the schedule is configured to start a job. The format for the delta-time is +[[dd:]HH:]MM.
The repeat interval is in the [[dd:]HH:]MM format, where each section represents a positive integer.
In this example, the job starts immediately and repeats every 48 hours.
|
Step 5
|
exit
Example:
switch(config-schedule)# exit
switch(config)#
|
Exits the schedule configuration mode and saves the schedule.
|
Step 6
|
show scheduler schedule [name]
Example:
switch(config)# show scheduler
schedule
|
(Optional) Displays the schedule information.
|
Step 7
|
copy running-config startup-config
Example:
switch(config)# copy running-config
startup-config
|
(Optional) Saves this configuration change.
|
The most significant fields in the time arguments are optional. If you omit the most significant fields, the values are assumed to be the same as the current time. For example, if the current time is March 24, 2008, 22:00 hours, then the commands are executed as follows:
•
The time start 23:00 repeat 4:00:00 command implies a start time of March 24, 2008, 23:00 hours.
•
The time daily 55 command implies every day at 22:55 hours.
•
The time weekly 23:00 command implies every Friday at 23:00 hours.
•
The time monthly 23:00 command implies the 24th of every month at 23:00 hours.
Note
If the time interval configured for any schedule is smaller than the time taken to execute its assigned job, then the subsequent schedule execution occurs only after the configured interval amount of time has elapsed following the completion time of the last iteration of the schedule. For example, a schedule is executed at 1-minute intervals and a job assigned to it takes 2 minutes to complete. If the first schedule is at 22:00 hours, the job finishes at 22:02 after which the 1-minute interval is observed and the next execution occurs at 22:03 and finishes at 22:05.
Configuring Execution Logs
You can configure the log file size to be a maximum of 1024 KB. The default size of the execution log file is 16 KB.
To configure the execution log file size, use the following command in global configuration mode:
Command
|
Purpose
|
scheduler logfile size value
Example:
switch(config)# scheduler logfile size 1024
|
Configures the log file size. The range is from 16 to 1024 KB. The default is 16KB.
|
Use the clear scheduler logfile command to clear this file.
Verifying the Command Scheduler Configuration
To display the command scheduler configuration information, use the following commands:
Command
|
Purpose
|
show scheduler config
|
Displays the command scheduler configuration.
|
show scheduler job [name string]
|
Displays the jobs configured.
|
show scheduler logfile
|
Displays the contents of the scheduler execution log file.
|
show scheduler schedule [name string]
|
Displays the schedules configured.
|
Default Settings
Table 6-1 lists the default settings for command scheduling parameters.
Table 6-1 Default Command Scheduler Parameters
Parameters
|
Default
|
Command scheduler
|
Disabled.
|
Log file size
|
16 KB.
|
Additional References
For additional information related to implementing scheduled jobs, see the following sections:
•
Related Documents
•
Standards
Related Documents
Related Topic
|
Document Title
|
Command scheduler CLI commands
|
Cisco Nexus 7000 Series NX-OS System Management Configuration Guide, Release 4.0
|
VDCs
|
Cisco Nexus 7000 Series NX-OS Virtual Device Context Configuration Guide, Release 4.0
|
Standards
Standards
|
Title
|
No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.
|
—
|