102
Configuring a scheduled task—approach 1
Follow these steps to configure a scheduled task:
To do…
Use the command…
Remarks
Specify a command to be
executed at the specified time
schedule job at
time
[
date
]
view
view
command
Specify a command to be
executed after the specified
delay
schedule job delay
time
view
view
command
Required
Use either command
Available in user view
•
If you use the
schedule job at
command,
changing the system time will change the
execution time of the scheduled task.
•
If you use the
schedule job delay
command,
changing the system time will not change the
execution time of the scheduled task.
Configuring a scheduled task—approach 2
Follow these steps to configure a scheduled task:
To do…
Use the command…
Remarks
Enter system view
system-view
—
Create a scheduled task
and enter job view
job
job-name
Required
Specify the view in which
the task is executed
view
view-name
Required
You can specify only one view for a task.
time
time-id
at
time date
command
command
Configure a command to
be executed at a specific
time
time
time-id
{
one-off
|
repeating
}
at
time
[
month-date
month-day
|
week-day
week-daylist
]
command
command
Configure a command to
be executed after a delay
time
time
time-id
{
one-off
|
repeating
}
delay
time
command
command
Required
Use any of the commands.
•
If you use the
time at
command,
changing the system time will change
the execution time of the scheduled
task.
•
If you use the
time delay
command,
changing the system time will not
change the execution time of the
scheduled task.
NOTE:
•
Only one view can be specified for a task, which means all commands in the task are executed in the
same specified view. If different views are specified by executing the
view
view-name command
repeatedly, only the last configuration takes effect.
•
The view must be supported by the system, and the view name must be complete instead of an
abbreviation. Most commonly used view names include:
monitor
for user view,
system
for system view,
GigabitEthernetx/x
for Ethernet interface view, and
Vlan-interfacex
for VLAN interface view.
•
A scheduled task can contain up to 10 commands. If you want more than 10 commands to be executed,
configure them in different tasks.
•
A
time-id uniquely identifies the binding between a command and its execution time. If two time-ids are
the same, the one configured later is effective.