08-28-2023 03:50 AM - edited 08-28-2023 03:51 AM
Hello,
We have a WLC 9800, we need to create a job to save its running config to its startup config daily at midnight to make sure that the daily configuration changes will remain in case the WLC reloads for whatever reason, especially that we forget to click the Save button sometimes after doing modifications on the WLC.
I tried using the EEM script below but it isn't actually saving (also please note that we use TACACS for the WLC adminstration):
event manager applet DAILY_CONFIG_SAVE authorization bypass
event timer cron cron-entry "0 0 * * *"
action 1.0 cli command "enable"
action 2.0 cli command "copy running-config startup-config"
action 3.0 syslog msg "Configuration saved by DAILY_CONFIG_SAVE"
In fact, the script is triggered and the syslog message is appearing , but the configurations not actually saved to the startup config.
Do you have any suggestion ? Or any alternative way to do it ?
Solved! Go to Solution.
08-28-2023 06:40 AM
You maybe forgot that by default copy running-config startup-config will always PROMPT the user. Since EEM is not an interactive shell with capability to respond to the prompt that will always fail. So you have 2 options:
- configure "file prompt quiet" before the copy then "no file prompt quiet" after. You also need to "conf t" and "end" to do that config obviously.
- use "write mem" instead of copy run start as that does not prompt. Cisco have threatened to remove the write command but it's still there all these years later so safe to keep using for now as long as you remember they might eventually remove it.
08-28-2023 06:40 AM
You maybe forgot that by default copy running-config startup-config will always PROMPT the user. Since EEM is not an interactive shell with capability to respond to the prompt that will always fail. So you have 2 options:
- configure "file prompt quiet" before the copy then "no file prompt quiet" after. You also need to "conf t" and "end" to do that config obviously.
- use "write mem" instead of copy run start as that does not prompt. Cisco have threatened to remove the write command but it's still there all these years later so safe to keep using for now as long as you remember they might eventually remove it.
08-29-2023 11:40 PM
Thank you Rich, switching to Write Memory instead of copy run start fixed the issue.
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