auto save running config

Unanswered Question
Feb 14th, 2008

Is it possible to auto save the running config to a TFTP server whenever someone enters config mode?

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Joe Clarke Thu, 02/14/2008 - 13:18

You could do this with the Embedded Event Manager provided your IOS is recent enough. Something like this should work:

event manager applet save_config

event cli pattern "configure terminal" sync no skip no

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "file prompt quiet"

action 4.0 cli command "end"

action 5.0 cli command "copy running tftp://10.1.1.1/router.cfg"

action 6.0 cli command "config t"

action 7.0 cli command "no file prompt quiet"

action 8.0 cli command "end"

set 9.0 set _exit_status 1

This would require you to have a file on the TFTP server with open permissions in order for the copy to succeed. This could be a security problem.

koksm Thu, 02/14/2008 - 23:41

hi,

This might do the trick. Security isn't the issue here, it is a closed test environment.

Thnx, never thought about using the event manager for this...

Joe Clarke Thu, 02/14/2008 - 23:57

There is a typo here. The policy should read:

event manager applet save_config

event cli pattern "configure terminal" sync no skip no

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "file prompt quiet"

action 4.0 cli command "end"

action 5.0 cli command "copy running tftp://10.1.1.1/router.cfg"

action 6.0 cli command "config t"

action 7.0 cli command "no file prompt quiet"

action 8.0 cli command "end"

set 9.0 _exit_status 1

Actions

This Discussion