Information About the Scheduler
The scheduler allows you to define and set a timetable for maintenance activities such as the following:
- Quality of Service policy changes
- Data backup
- Saving a configuration
Jobs consist of a single command or multiple commands that define routine activities. Jobs can be scheduled one time or at periodic intervals.
This section includes the following topics:
Scheduler Overview
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:
– Periodic mode—A recurring interval that continues until you delete the job. You can configure the following types of intervals:
Daily—Job is completed once a day.
Weekly—Job is completed once a week.
Monthly—Job is completed once a month.
Delta—Job begins at the specified start time and then at specified intervals (days:hours:minutes).
– One-time mode—Job is completed only once at a specified time.
Remote User Authentication
Before starting a job, the scheduler authenticates the user who created the job. Since user credentials from a remote authentication are not retained long enough to support a scheduled job, you need to 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.
Logs
The scheduler maintains a log file containing the job output. If the size of the job output is greater than the size of the log file, then the output is truncated. For more information, see the Defining the Scheduler Log File Size.
High Availability
Scheduled jobs remain available after a supervisor switchover or a software reload.
Virtualization Support
Jobs are created in the virtual device context (VDC) that you are logged into. By default, Cisco NX-OS places you in the default VDC. For more information, see the Cisco Nexus 7000 Series NX-OS Virtual Device Context Configuration Guide, Release 5.x.
Configuring the Scheduler
This section includes the following topics:
Enabling the Scheduler
You can enable the scheduler feature so that you can configure and schedule jobs.
BEFORE YOU BEGIN
Make sure that you are in the correct VDC. To change the VDC, use the switchto vdc command.
SUMMARY STEPS
1. config t
2. feature scheduler
3. show scheduler config
4. copy running-config startup-config
DETAILED STEPS
:
|
|
|
Step 1 |
config t Example: switch# config t Enter configuration commands, one per line. End with CNTL/Z. switch(config)# |
Places you in global configuration mode. |
Step 2 |
feature scheduler Example: switch(config)# feature scheduler |
Enables the scheduler in the current VDC. |
Step 3 |
show scheduler config Example : switch(config)# show scheduler config config terminal feature scheduler scheduler logfile size 16 end switch(config)# |
(Optional) Displays the scheduler configuration. |
Step 4 |
copy running-config startup-config Example:
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. |
Defining the Scheduler Log File Size
You can configure the log file size for capturing jobs, schedules, and job output.
BEFORE YOU BEGIN
Make sure that you are in the correct VDC. To change the VDC, use the switchto vdc command.
SUMMARY STEPS
1. config t
2. scheduler logfile size value
3. copy running-config startup-config
DETAILED STEPS
|
|
|
Step 1 |
config t Example: switch# config t Enter configuration commands, one per line. End with CNTL/Z. switch(config)# |
Places you in global configuration mode. |
Step 2 |
scheduler logfile size value Example : switch(config)# scheduler logfile size 1024 |
Defines the scheduler log file size in kilobytes. The range is from 16 to 1024. The default is 16. Note If the size of the job output is greater than the size of the log file, then the output is truncated. |
Step 3 |
copy running-config startup-config Example:
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. |
Configuring Remote User Authentication
You can configure the scheduler to use remote authentication for users who want to configure and schedule jobs.
Note Remote users must authenticate with their clear text password before creating and configuring jobs.
Note 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.
BEFORE YOU BEGIN
Make sure that you are in the correct VDC. To change the VDC, 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
:
|
|
|
Step 1 |
config t Example: switch# config t Enter configuration commands, one per line. End with CNTL/Z. switch(config)# |
Places you in global 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 user who is currently logged in. |
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 the change persistently through reboots and restarts by copying the running configuration to the startup configuration. |
Defining a Job
You can define a job including the job name and the command sequence.
Caution
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.
BEFORE YOU BEGIN
Make sure that you are in the correct VDC. To change the VDC, use the switchto vdc command.
SUMMARY STEPS
1. config t
2. scheduler job name string
3. command1 ;[ command2 ; command3 ;...]
4. show scheduler job [ name name ]
5. copy running-config startup-config
DETAILED STEPS
|
|
|
Step 1 |
config t Example: switch# config t Enter configuration commands, one per line. End with CNTL/Z. switch(config)# |
Places you in global configuration mode. |
Step 2 |
scheduler job name string Example: switch(config)# scheduler job name backup-cfg switch(config-job) |
Creates a job and enters job configuration mode. This example creates a scheduler job named backup-cfg. |
Step 3 |
command1 ; [ command2 ; command3 ;...] Example: 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)# |
Defines the sequence of commands for the specified job. You must separate commands with a space and a semicolon (for example, “ ;”). This example creates 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 file name is created using the current time stamp and switch name. |
Step 4 |
show scheduler job [ name name ] Example : switch(config-job)# show scheduler job |
(Optional) Displays the job information. |
Step 5 |
copy running-config startup-config Example:
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. |
Deleting a Job
You can delete a job from the scheduler.
BEFORE YOU BEGIN
Make sure that you are in the correct VDC. To change the VDC, use the switchto vdc command.
SUMMARY STEPS
1. config t
2. no scheduler job name string
3. show scheduler job [ name name ]
4. copy running-config startup-config
DETAILED STEPS
|
|
|
Step 1 |
config t Example: switch# config t Enter configuration commands, one per line. End with CNTL/Z. switch(config)# |
Places you in global configuration mode. |
Step 2 |
no scheduler job name string Example: switch(config)# no scheduler job name configsave switch(config-job) |
Deletes the specified job and all commands defined within it. |
Step 3 |
show scheduler job [ name name ] Example : switch(config-job)# show scheduler job name configsave |
(Optional) Displays the job information. |
Step 4 |
copy running-config startup-config Example:
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. |
Defining a Timetable
You can define a timetable in the scheduler to be used with one or more jobs.
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, then 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.
BEFORE YOU BEGIN
Make sure that you are in the correct VDC. To change the VDC, use the switchto vdc command.
SUMMARY STEPS
1. config t
2. scheduler schedule name string
3. job name string
4. time daily time
time weekly [[dow:] HH:]MM
time monthly [[dm:] HH:] MM
time start { now repeat repeat-interval | delta-time [ repeat repeat-interval ]}
5. show scheduler schedule [name]
6. copy running-config startup-config
DETAILED STEPS
|
|
|
Step 1 |
config t Example: switch# config t Enter configuration commands, one per line. End with CNTL/Z. switch(config)# |
Places you in global configuration mode. |
Step 2 |
scheduler schedule name string Example: switch(config)# scheduler schedule name weekendbackupqos switch(config-schedule)# |
Creates a new schedule and places you in schedule configuration mode for that schedule. |
Step 3 |
job name string Example: switch(config-schedule)# job name offpeakZoning |
Associates a job with this schedule. You can add multiple jobs to a schedule. |
Step 4 |
time daily time Example: switch(config-schedule)# time daily 23:00 |
Indicates the job starts every day at a designated time specified as HH:MM. |
|
time weekly [[ dow : ] HH :] MM Example: switch(config-schedule)# time weekly Sun:23:00 |
Indicates that the job starts on a specified day of the week.
- Day of the week (dow) specified as one of the following:
– An integer such as 1 = Sunday, 2 = Monday, and so on. – An abbreviation such as Sun = Sunday. The maximum length for the entire argument is 10. |
|
time monthly [[ dm : ] HH :] MM Example: switch(config-schedule)# time monthly 28:23:00 |
Indicates the job starts on a specified day each month (dm). If you specify either 29, 30, or 31, the job is started on the last day of each month. |
|
time start { now repeat repeat-interval | delta-time [ repeat repeat-interval ]} Example: switch(config-schedule)# time start now repeat 48:00 |
Indicates the job starts periodically. The start-time format is [[[[yyyy:]mmm:]dd:]HH]:MM.
- delta-time
Specifies the amount of time to wait after the schedule is configured before starting a job.
- now
Specifies that the job starts now.
- repeat repeat-interval
Specifies the frequency at which the job is repeated
In this example, the job starts immediately and repeats every 48 hours. |
Step 5 |
show scheduler config Example : switch(config)# show scheduler config |
(Optional) Displays the scheduler configuration. |
Step 6 |
copy running-config startup-config Example:
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. |
Clearing the Scheduler Log File
You can clear the scheduler log file.
BEFORE YOU BEGIN
Make sure that you are in the correct VDC. To change the VDC, use the switchto vdc command.
SUMMARY STEPS
1. clear scheduler logfile
DETAILED STEPS
|
|
|
Step 1 |
clear scheduler logfile Example : switch(config)# clear scheduler logfile |
Clears the scheduler log file. |
Disabling the Scheduler
You can disable the scheduler feature.
BEFORE YOU BEGIN
The scheduler feature must be enabled before you can configure and schedule jobs.
Make sure that you are in the correct VDC. To change the VDC, use the switchto vdc command.
SUMMARY STEPS
1. config t
2. no feature scheduler
3. show scheduler config
4. copy running-config startup-config
DETAILED STEPS
:
|
|
|
Step 1 |
config t Example: switch# config t Enter configuration commands, one per line. End with CNTL/Z. switch(config)# |
Places you in global configuration mode. |
Step 2 |
no feature scheduler Example: switch(config)# no feature scheduler |
Disables the scheduler in the current VDC. |
Step 3 |
show scheduler config Example : switch(config)# show scheduler config ^ % Invalid command at '^' marker. switch(config)# |
(Optional) Displays the scheduler configuration. In this example, the scheduler feature is disabled so the command is not recognized. |
Step 4 |
copy running-config startup-config Example:
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. |