There are multiple ways you can automate the work on cisco device ( Router, Switch ), Kron is one of the useful tool:
If you have touched the crontab in Linux, Cisco kron is doing similar job.
create a policy list
First step is create a kron policy-list, which tells the device what command to issue. I will create a task to backup the running configure of switch in K13 office to a tftp server with IP 192.168.17.98:
conf t kron policy-list BU-CONF cli copy run tftp://192.168.17.98/K13office_01
Schedule this policy:
1. configure this schedule to be weekly at 00:00 sunday:
(config)#kron occurrence BU-CONF-WEEKLY at 00:00 SUN recurring
2. Tell the schedule which policy to run:
This can be useful if your NAT table get flooded if you open some service to Internet, so you can schedule the command
clear ip nat translation * at a regular interval.
With Event manager, you
conf t event manager applet CLEAR-NAT-TABLE event timer cron cron-entry "* 10 * * 1-5" action 1 cli command "enable" action 2 cli command "clear ip nat translation *" action 3 cli command "send log 5 'NAT table cleared'"
This will create a event runs at 10 monday to Friday, it will enable the privilege mode, then clear the NAT table, and send a notice message: “NAT table cleared” .
Note that, you need to use single quotation and double quotation