logo

Poor mans kron

en January 03 , 2018
Use the Cisco IOS command scheduler
For example, let's say you want to automatically back up your router's running configuration (in RAM) to the startup configuration (in NVRAM) every Monday night at 10 P.M. You might want to make sure that the system is preserving router changes, even if the router losses power and even if someone forgets to save his or her changes.
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:

TERMINAL

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:

TERMINAL

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.

TERMINAL

TERMINAL

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.
© Copyright 2024 PA2JFX      Hosted by Strato B.V.