cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4335
Views
5
Helpful
6
Replies

Can we run copy command in Cisco ios xr silently i.e. without user prompt

sjaiswal
Level 1
Level 1

Hi,

 

I wanted to know if I can somehow run silently without the user being prompted for yes/no:

copy running-config disk0:test_config

 or is there any other way I can achieve the use case without user's input.

 

Thanks.

2 Accepted Solutions

Accepted Solutions

Santosh Sharma
Cisco Employee
Cisco Employee

You can try "show run | file disk0:show_run"

Thanks,

Santosh

View solution in original post

Hi,

 

In addition to what Santosh suggested, Following alternate also should help.

 

RP/0/RSP1/CPU0:ASR9006-L(config)#service cli interactive disable

RP/0/RSP1/CPU0:ASR9006-L(config)#commit

 

RP/0/RSP1/CPU0:ASR9006-L#show running-config | file test_config

Fri Aug 31 02:34:52.401 EDT

Building configuration...

.............

[OK]

RP/0/RSP1/CPU0:ASR9006-L#

RP/0/RSP1/CPU0:ASR9006-L#show running-config | file test_config 

Fri Aug 31 02:38:25.297 EDT

Building configuration...

............

[OK]

RP/0/RSP1/CPU0:ASR9006-L#

 

Regards,

Ashish

View solution in original post

6 Replies 6

Santosh Sharma
Cisco Employee
Cisco Employee

You can try "show run | file disk0:show_run"

Thanks,

Santosh

Thanks, Santosh for your quick response this command "show run | file disk0:show_run" solves 1st part of trying to save the "running-config" in the file named "test_config" without the user being prompted but when I run this the second time it'll prompt the user for confirmation to overwrite the existing file.

 

Can I somehow skip that user confirmation too? I can achieve the similar scenario in IOS devices by modifying the config via command "file prompt quiet".

 

But sadly this doesn't work for IOS-XR devices.

I dont think we can do it from XR prompt, but we can do it from shell prompt:

# nvgen -c -l 1 -t 1 -o 1 > /disk0:/show_run1  
Building configuration...
# ls -lrt show_run1
-rw-rw-rw-  1 0         0             39211 Aug 31 13:30 show_run1
#

Here is more details:

RP/0/RSP0/CPU0:ASR9K-Escalation#run        
# nvgen -c -l 1 -t 1 -o 1 > /disk0:/show_run1
Building configuration...
# ls -lrt show_run1
-rw-rw-rw-  1 0         0             39211 Aug 31 13:30 show_run1
#

# nvgen -c -l 1 -t 1 -o 1 > /disk0:/show_run1
Building configuration...
# ls -lrt show_run1                            
-rw-rw-rw-  1 0         0             39211 Aug 31 13:32 show_run1
#

Hi,

 

In addition to what Santosh suggested, Following alternate also should help.

 

RP/0/RSP1/CPU0:ASR9006-L(config)#service cli interactive disable

RP/0/RSP1/CPU0:ASR9006-L(config)#commit

 

RP/0/RSP1/CPU0:ASR9006-L#show running-config | file test_config

Fri Aug 31 02:34:52.401 EDT

Building configuration...

.............

[OK]

RP/0/RSP1/CPU0:ASR9006-L#

RP/0/RSP1/CPU0:ASR9006-L#show running-config | file test_config 

Fri Aug 31 02:38:25.297 EDT

Building configuration...

............

[OK]

RP/0/RSP1/CPU0:ASR9006-L#

 

Regards,

Ashish

I am able to resolve my issue Thanks, Santosh and Ashish for the quick resolution.

 

I highly appreciate your help guys. :)

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: