04-28-2014 10:41 PM - edited 03-03-2019 07:22 AM
When I configure onto a router, the configurations are stored in running configuration and it requires for me to run "wr" command to store running configurations onto startup configuration. Thus, this enables the configurations to be retained even after router restart.
Is there any mechanism, wherein any configuration that I do on the router, should by default be written onto startup configuration, without me explicitly invoking the "wr" command every time.
04-28-2014 11:55 PM
Hi msgforsunil,
you have several ways of saving your config on the tftp server on a timely basis. You ask if for saving the config everytime you run a command on the router.
kindly run the following clis on the router to have this executed:
conf t
event manager applet MANAGEWRITE
event cli pattern ".*" sync no skip no
action 1.0 cli command "wr mem"
action 2.0 cli command "do wr mem"
action 3.0 cli command "enable"
action 4.0 cli command "wr mem"
The term MANAGEWRITE here highlighted in GREEN is just a name. You can name it whatever you wish.
Hope this answers your query. Let me know if you have any doubts....
Thanks,,,
04-29-2014 12:23 AM
Thanks a lot!
04-29-2014 10:10 PM
Hi tanvsult
This seems to slow down the performance of the router. Any other better alternative?
Thank you.
04-29-2014 11:34 PM
Hi,
The whole idea of not doing a write automatically is to make sure that changes that might cause issues to the working condition of the router can be avoided and in the worst case when they reload the router, it should come up with the good old config that was available in the start-up config.
In your case you wanted every line of config to be written in the startup, which is not a good idea.
What you can do is, you can do a periodical write on the tftp server. This could be every day or every week.
Thanks,
04-30-2014 02:49 AM
Could the write be scheduled, say once in 5 hours or so, the running config to be copied to startup config? If yes, can you please share the updated solution?
Thank you.
04-30-2014 09:01 AM
Hi,
As mentioned, there are several ways to do a periodic backup. You have commands that range from two lines to several lines. I use the following to do a write mem every 6 hours daily.
kron occurrence daily1 at 00:00 recurring
policy-list save-config
kron occurrence daily2 at 06:00 recurring
policy-list save-config
kron occurrence daily3 at 12:00 recurring
policy-list save-config
kron occurrence daily4 at 18:00 recurring
policy-list save-config
kron policy-list save-config
cli write memory
If you want to do a write mem every one hour, You can use the following commands
event manager applet WR_Conf
event timer cron name WR_Conf cron-entry " 25 * * * *"
action 1.0 cli command "enable"
action 1.1 cli command "wr"
action 1.2 syslog msg "Config has been saved by EEM script"
Thanks,
05-01-2014 01:19 AM
DO not worry about the number 25 in the entry " event timer cron name WR_Conf cron-entry " 25 * * * *" "
This can be anything between 0 and 59. it will repeat it every 60 minutes as the clock strikes the same number in the minutes field every 60 minutes.
05-01-2014 08:32 AM
Thank you very much.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide