Cisco 计划任务Kron

the new IOS command scheduler makes this a relatively easy task. Here's how you can use kron to accomplish this.

First, create a kron policy list. Essentially, this policy list serves as your "script," which lists what you want the router to run at a scheduled time. Here's an example:


Router(config)# kron policy-list backup
Router(config-kron-policy)# cli write
Router(config-kron-policy)# exit


Next, create a kron occurrence, in which you tell the router when and how often you want to run this policy list (i.e., group of commands). Here's an example:

Router(config)# kron occurrence backup at 22:00 Mon recurring
Router(config-kron-occurrence)# policy-list backup


This code sets up your backup job to run every Monday night at 10 P.M. (22:00 in military time).

Finally, verify that you've entered everything correctly by using the show command.


Router# show kron schedule

Kron Occurrence Schedule
backup inactive, will run again in 2 days 22:03:46 at 22:00 on Mon

Router# show running-configuration
(truncated)
kron occurrence backup at 22:00 Mon recurring
policy-list backup
!
kron policy-list backup
cli write
(truncated)


You might be wondering why I used the write command instead of the copy running-configuration startup-configuration commands. While the copy run start command is interactive, the write command is not. In other words, write doesn't prompt to verify what you want to do. It's important to remember that the Cisco IOS Command Scheduler doesn't allow any interactive commands.


kron命令的使用:
1、首先创建一个kron policy list
2、创建一个kron occurrence 并调用kron policy
3、查看kron计划任务sh kron schedule


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值