02-19-2021 01:53 PM
Good Afternoon?
I am trying to configure EEM to run an automated backup using the following:
event manager applet DAILY_STARTUP_CONFIG_BACKUP
event timer watchdog time 86400
action 0 cli command copy /noconfirm start scp://abc:123@192.168.1.10/ROUTER/START
I cant get it to work. It works fine in my ASA config.
Ideas???
Thanks!!!!!!!
Solved! Go to Solution.
02-19-2021 10:10 PM - edited 02-19-2021 10:27 PM
Also since you requested it, here is the EEM script that would do the same thing:
event manager applet BACKUP-CONFIG event timer watchdog time 86400 action 010 cli command "enable" action 020 cli command "write memory" action 030 cli command "copy running-config scp://abc:123@192.168.1.10/ROUTER/START" pattern "Address" action 040 cli command "" pattern "Destination" action 050 cli command "" pattern "Destination" action 060 cli command ""
If you need to trouble shoot it, you can do so with the following:
terminal monitor debug event manager action cli
The following command will tell you how long it will before the script runs again:
show event manager statistics server
02-19-2021 02:53 PM
Consider the "Archive" command
archive path scp://abc:123@192.168.1.10/ROUTERS/START write-memory time-period 86400
02-19-2021 03:20 PM
We are currently required to use the archive function to backup locally to flash for compliance reasons.
I need to be able to transfer it out on a scheduled task.
Thanks
02-19-2021 05:54 PM
In that case, you could still use the archive command but in conjunction with the kron scheduler. The following commands uses the archive to send to the SCP server any time the switch saves a local copy of the configuration to flash. The kron scheduler creates a policy that executes the "write memory" command every day at 02:00am (make sure your clock is correct on the switch). The actions of the kron job backs up the running configuration to the startup configuration in flash and in by doing so, invokes the archive to send a copy to the remote SCP server.
archive path scp://abc:123@192.168.1.10/ROUTERS/START write-memory ! kron occurrence DAILY at 02:00 recurring policy-list CONFIG-LOCAL-BACKUP ! kron policy-list CONFIG-LOCAL-BACKUP cli write memory
02-19-2021 06:59 PM
Are you sure this is going to work on a router...???
I will try it on Monday and keep you posted.
02-19-2021 10:10 PM - edited 02-19-2021 10:27 PM
Also since you requested it, here is the EEM script that would do the same thing:
event manager applet BACKUP-CONFIG event timer watchdog time 86400 action 010 cli command "enable" action 020 cli command "write memory" action 030 cli command "copy running-config scp://abc:123@192.168.1.10/ROUTER/START" pattern "Address" action 040 cli command "" pattern "Destination" action 050 cli command "" pattern "Destination" action 060 cli command ""
If you need to trouble shoot it, you can do so with the following:
terminal monitor debug event manager action cli
The following command will tell you how long it will before the script runs again:
show event manager statistics server
02-20-2021 12:06 PM
Heck yeah man!!!
I will be testing first thing on Monday! Thanks for a potentially great solution!
02-23-2021 04:18 PM
Works as needed! Thank you!
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