Schedule configuration example
Network requirements
As shown in Figure 3, two interfaces of the device are connected to users.
To save energy, configure the device to perform the following operations:
Enable interfaces Ten-GigabitEthernet 1/0/1 and Ten-GigabitEthernet 1/0/2 at 8:00 a.m. every Monday through Friday.
Disable the interfaces at 18:00 every Monday through Friday.
Figure 37: Network diagram
Scheduling procedure
# Enter system view.
<Sysname> system-view
# Configure a job for disabling interface Ten-GigabitEthernet 1/0/1.
[Sysname] scheduler job shutdown-Ten-GigabitEthernet1/0/1 [Sysname-job-shutdown-Ten-GigabitEthernet1/0/1] command 1 system-view [Sysname-job-shutdown-Ten-GigabitEthernet1/0/1] command 2 interface ten-gigabitethernet 1/0/1 [Sysname-job-shutdown-Ten-GigabitEthernet1/0/1] command 3 shutdown [Sysname-job-shutdown-Ten-GigabitEthernet1/0/1] quit
# Configure a job for enabling interface Ten-GigabitEthernet 1/0/1.
[Sysname] scheduler job start-Ten-GigabitEthernet1/0/1 [Sysname-job-start-Ten-GigabitEthernet1/0/1] command 1 system-view [Sysname-job-start-Ten-GigabitEthernet1/0/1] command 2 interface ten-gigabitethernet 1/0/1 [Sysname-job-start-Ten-GigabitEthernet1/0/1] command 3 undo shutdown [Sysname-job-start-Ten-GigabitEthernet1/0/1] quit
# Configure a job for disabling interface Ten-GigabitEthernet 1/0/2.
[Sysname] scheduler job shutdown-Ten-GigabitEthernet1/0/2 [Sysname-job-shutdown-Ten-GigabitEthernet1/0/2] command 1 system-view [Sysname-job-shutdown-Ten-GigabitEthernet1/0/2] command 2 interface ten-gigabitethernet 1/0/2 [Sysname-job-shutdown-Ten-GigabitEthernet1/0/2] command 3 shutdown [Sysname-job-shutdown-Ten-GigabitEthernet1/0/2] quit
# Configure a job for enabling interface Ten-GigabitEthernet 1/0/2.
[Sysname] scheduler job start-Ten-GigabitEthernet1/0/2 [Sysname-job-start-Ten-GigabitEthernet1/0/2] command 1 system-view [Sysname-job-start-Ten-GigabitEthernet1/0/2] command 2 interface ten-gigabitethernet 1/0/2 [Sysname-job-start-Ten-GigabitEthernet1/0/2] command 3 undo shutdown [Sysname-job-start-Ten-GigabitEthernet1/0/2] quit
# Configure a periodic schedule for enabling the interfaces at 8:00 a.m. every Monday through Friday.
[Sysname] scheduler schedule START-pc1/pc2 [Sysname-schedule-START-pc1/pc2] job start-Ten-GigabitEthernet1/0/1 [Sysname-schedule-START-pc1/pc2] job start-Ten-GigabitEthernet1/0/2 [Sysname-schedule-START-pc1/pc2] time repeating at 8:00 week-day mon tue wed thu fri [Sysname-schedule-START-pc1/pc2] quit
# Configure a periodic schedule for disabling the interfaces at 18:00 every Monday through Friday.
[Sysname] scheduler schedule STOP-pc1/pc2 [Sysname-schedule-STOP-pc1/pc2] job shutdown-Ten-GigabitEthernet1/0/1 [Sysname-schedule-STOP-pc1/pc2] job shutdown-Ten-GigabitEthernet1/0/2 [Sysname-schedule-STOP-pc1/pc2] time repeating at 18:00 week-day mon tue wed thu fri [Sysname-schedule-STOP-pc1/pc2] quit
Verifying the scheduling
# Display the configuration information of all jobs.
[Sysname] display scheduler job Job name: shutdown-Ten-GigabitEthernet1/0/1 system-view interface ten-gigabitethernet 1/0/1 shutdown Job name: shutdown-Ten-GigabitEthernet1/0/2 system-view interface ten-gigabitethernet 1/0/2 shutdown Job name: start-Ten-GigabitEthernet1/0/1 system-view interface ten-gigabitethernet 1/0/1 undo shutdown Job name: start-Ten-GigabitEthernet1/0/2 system-view interface ten-gigabitethernet 1/0/2 undo shutdown
# Display the schedule information.
[Sysname] display scheduler schedule Schedule name : START-pc1/pc2 Schedule type : Run on every Mon Tue Wed Thu Fri at 08:00:00 Start time : Wed Sep 28 08:00:00 2011 Last execution time : Wed Sep 28 08:00:00 2011 Last completion time : Wed Sep 28 08:00:03 2011 Execution counts : 1 ----------------------------------------------------------------------- Job name Last execution status start-Ten-GigabitEthernet1/0/1 Successful start-Ten-GigabitEthernet1/0/2 Successful Schedule name : STOP-pc1/pc2 Schedule type : Run on every Mon Tue Wed Thu Fri at 18:00:00 Start time : Wed Sep 28 18:00:00 2011 Last execution time : Wed Sep 28 18:00:00 2011 Last completion time : Wed Sep 28 18:00:01 2011 Execution counts : 1 ----------------------------------------------------------------------- Job name Last execution status shutdown-Ten-GigabitEthernet1/0/1 Successful shutdown-Ten-GigabitEthernet1/0/2 Successful
# Display schedule log information.
[Sysname] display scheduler logfile Logfile Size: 16054 Bytes. Job name : start-Ten-GigabitEthernet1/0/1 Schedule name : START-pc1/pc2 Execution time : Wed Sep 28 08:00:00 2011 Completion time : Wed Sep 28 08:00:02 2011 --------------------------------- Job output ----------------------------------- <Sysname>system-view System View: return to User View with Ctrl+Z. [Sysname]interface ten-gigabitethernet 1/0/1 [Sysname-Ten-GigabitEthernet1/0/1]undo shutdown Job name : start-Ten-GigabitEthernet1/0/2 Schedule name : START-pc1/pc2 Execution time : Wed Sep 28 08:00:00 2011 Completion time : Wed Sep 28 08:00:02 2011 --------------------------------- Job output ----------------------------------- <Sysname>system-view System View: return to User View with Ctrl+Z. [Sysname]interface ten-gigabitethernet 1/0/2. [Sysname-Ten-GigabitEthernet1/0/2]undo shutdown Job name : shutdown-Ten-GigabitEthernet1/0/1 Schedule name : STOP-pc1/pc2 Execution time : Wed Sep 28 18:00:00 2011 Completion time : Wed Sep 28 18:00:01 2011 --------------------------------- Job output ----------------------------------- <Sysname>system-view System View: return to User View with Ctrl+Z. [Sysname]interface ten-gigabitethernet 1/0/1 [Sysname-Ten-GigabitEthernet1/0/1]shutdown Job name : shutdown-Ten-GigabitEthernet1/0/2 Schedule name : STOP-pc1/pc2 Execution time : Wed Sep 28 18:00:00 2011 Completion time : Wed Sep 28 18:00:01 2011 --------------------------------- Job output ----------------------------------- <Sysname>system-view System View: return to User View with Ctrl+Z. [Sysname]interface ten-gigabitethernet 1/0/2 [Sysname-Ten-GigabitEthernet1/0/2]shutdown