Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

ASR 9000 configuration backup


Need a simple script (TCL/EEM) that backs up running-config of an ASR9k router on a daily basis.

Destination FTP och SFTP via a VRF



Everyone's tags (1)
Cisco Employee

this is maybe even nicer, we

this is maybe even nicer, we set a trigger on the MGBL commit from XR and then trigger a config backup right away:

event syslog pattern "%MGBL-CONFIG-6-DB_COMMIT : Configuration committed by user"

for more detail on the setup of eem check here:


here is an example script:

namespace import ::cisco::eem::*
namespace import ::cisco::lib::*

array set arr_einfo [event_reqinfo]

if [catch {cli_open} result] {
    error $result $errorInfo
} else {
    array set cli1 $result

array set _sinfo [sys_reqinfo_routername]
set _info_routername $_sinfo(routername)
if [catch {cli_write $cli1(fd) "copy run tftp"} _cli_result] {
    error $_cli_result $errorInfo

if [catch {cli_read_pattern $cli1(fd) "Address"} _cli_result] {
    error $_cli_result $errorInfo

if [catch {cli_write $cli1(fd) "w.x.y.z"} _cli_result] {
    error $_cli_result $errorInfo

if [catch {cli_read_pattern $cli1(fd) "filename"} _cli_result] {
    error $_cli_result $errorInfo

if [catch {cli_exec $cli1(fd) } _cli_result] {
    error $_cli_result $errorInfo

action_syslog msg 

# Close open cli before exit.
catch {cli_close $cli1(fd) $cli1(tty_id)} result
Xander Thuijs CCIE #6775 Principal Engineer ASR9000, CRS, NCS6000 & IOS-XR
New Member

I have this problem too

I have this problem too

Can anyone help us?

Cisco Employee

What problem are you having?

What problem are you having? How about you configure the router to do the backup each time the config is changed, take a look at the following:



New Member



But one more thing. When I use auto-save command there's a problem:

my ftp server's name: cisco

Password: snoc@123

When I excute the command: configuration commit auto-save filename ftp://cisco:snoc@123@

The system cant understand the server IP but 123@

Is there anyway to troubleshoot this? (I cant change password because it is related to many other things).


Cisco Employee

Break it down as such and see

Break it down as such and see if it works. Else you might need to change the password:

configuration commit auto-save filename

ftp client password snoc@123

ftp client username cisco

let me know how it goes. 


New Member

It's OK now. Thanks verymuch!

It's OK now.

Thanks verymuch!

CreatePlease login to create content