最佳答案
对Device进行配置,在星期一到星期五的上午八点到下午十八点开启Ten-GigabitEthernet1/0/25和Ten-GigabitEthernet1/0/26,其它时间关闭端口,以便起到有效节能的作用。
图1-4 定时执行任务典型配置举例组网图
# 进入系统视图。
<Sysname> system-view
# 创建关闭Ten-GigabitEthernet1/0/25的Job。
[Sysname] scheduler job shutdown-Ten-GigabitEthernet1/0/25
[Sysname-job-shutdown-Ten-GigabitEthernet1/0/25] command 1 system-view
[Sysname-job-shutdown-Ten-GigabitEthernet1/0/25] command 2 interface ten-gigabitethernet 1/0/25
[Sysname-job-shutdown-Ten-GigabitEthernet1/0/25] command 3 shutdown
[Sysname-job-shutdown-Ten-GigabitEthernet1/0/25] quit
# 创建开启Ten-GigabitEthernet1/0/25的Job。
[Sysname] scheduler job start-Ten-GigabitEthernet1/0/25
[Sysname-job-start-Ten-GigabitEthernet1/0/25] command 1 system-view
[Sysname-job-start-Ten-GigabitEthernet1/0/25] command 2 interface ten-gigabitethernet 1/0/25
[Sysname-job-start-Ten-GigabitEthernet1/0/25] command 3 undo shutdown
[Sysname-job-start-Ten-GigabitEthernet1/0/25] quit
# 创建关闭Ten-GigabitEthernet1/0/26的Job。
[Sysname] scheduler job shutdown-Ten-GigabitEthernet1/0/26
[Sysname-job-shutdown-Ten-GigabitEthernet1/0/26] command 1 system-view
[Sysname-job-shutdown-Ten-GigabitEthernet1/0/26] command 2 interface ten-gigabitethernet 1/0/26
[Sysname-job-shutdown-Ten-GigabitEthernet1/0/26] command 3 shutdown
[Sysname-job-shutdown-Ten-GigabitEthernet1/0/26] quit
# 创建开启Ten-GigabitEthernet1/0/26的Job。
[Sysname] scheduler job start-Ten-GigabitEthernet1/0/26
[Sysname-job-start-Ten-GigabitEthernet1/0/26] command 1 system-view
[Sysname-job-start-Ten-GigabitEthernet1/0/26] command 2 interface ten-gigabitethernet 1/0/26
[Sysname-job-start-Ten-GigabitEthernet1/0/26] command 3 undo shutdown
[Sysname-job-start-Ten-GigabitEthernet1/0/26] quit
# 配置定时执行任务,使Device在星期一到星期五的上午八点开启pc1、pc2对应的以太网端口。
[Sysname] scheduler schedule START-pc1/pc2
[Sysname-schedule-START-pc1/pc2] job start-Ten-GigabitEthernet1/0/25
[Sysname-schedule-START-pc1/pc2] job start-Ten-GigabitEthernet1/0/26
[Sysname-schedule-START-pc1/pc2] time repeating at 8:00 week-day mon tue wed thu fri
[Sysname-schedule-START-pc1/pc2] quit
# 配置定时执行任务,使Device在星期一到星期五的下午十八点关闭pc1、pc2对应的以太网端口。
[Sysname] scheduler schedule STOP-pc1/pc2
[Sysname-schedule-STOP-pc1/pc2] job shutdown-Ten-GigabitEthernet1/0/25
[Sysname-schedule-STOP-pc1/pc2] job shutdown-Ten-GigabitEthernet1/0/26
[Sysname-schedule-STOP-pc1/pc2] time repeating at 18:00 week-day mon tue wed thu fri
[Sysname-schedule-STOP-pc1/pc2] quit
# 显示Job的配置信息。
[Sysname] display scheduler job
Job name: shutdown-Ten-GigabitEthernet1/0/25
system-view
interface ten-gigabitethernet 1/0/25
shutdown
Job name: shutdown-Ten-GigabitEthernet1/0/26
system-view
interface ten-gigabitethernet 1/0/26
shutdown
Job name: start-Ten-GigabitEthernet1/0/25
system-view
interface ten-gigabitethernet 1/0/25
undo shutdown
Job name: start-Ten-GigabitEthernet1/0/26
system-view
interface ten-gigabitethernet 1/0/26
undo shutdown
# 显示定时任务的运行信息。
[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/25 Successful
start-Ten-GigabitEthernet1/0/26 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/25 Successful
shutdown-Ten-GigabitEthernet1/0/26 Successful
# 显示Job运行的输出信息。
[Sysname] display scheduler logfile
Job name : start-Ten-GigabitEthernet1/0/25
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/25
[Sysname-Ten-GigabitEthernet1/0/25]undo shutdown
Job name : start-Ten-GigabitEthernet1/0/26
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/26
[Sysname-Ten-GigabitEthernet1/0/26]undo shutdown
Job name : shutdown-Ten-GigabitEthernet1/0/25
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/25
[Sysname-Ten-GigabitEthernet1/0/25]shutdown
Job name : shutdown-Ten-GigabitEthernet1/0/26
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/26
[Sysname-Ten-GigabitEthernet1/0/26]shutdown
(0)
创建定时备份的Job
[H3C]scheduler job saveconfig
[H3C-job-saveconfig]command 1 save force //保存配置
[H3C-job-saveconfig]command 2 copy startup.cfg ftp://admin:admin123@10.88.142.121/ceshi.cfg //备份到ftp服务器对应路径,并修改文件名,ftp服务器用户名admin、密码admin123,地址10.88.142.121
[H3C-job-saveconfig]quit
# 配置定时执行任务,使设备在每个星期五的下午6点执行备份操作
[H3C]scheduler schedule saveconfig
[H3C-schedule-saveconfig]job saveconfig
[H3C-schedule-saveconfig]time repeating at 18:00 week-day Fri
[H3C-schedule-saveconfig]quit
1、由于job不支持执行ftp命令,使用copy变相实现
2、ftp命令脚本为ftp://username:passwd@servername/filename
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论