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

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

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.

Everyone's tags (1)
2 ACCEPTED SOLUTIONS

Accepted Solutions
Cisco Employee

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

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

Thanks,

Santosh

Cisco Employee

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

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

6 REPLIES 6
Cisco Employee

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

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

Thanks,

Santosh

Highlighted
Beginner

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

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.

Cisco Employee

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

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
#

Cisco Employee

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

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
#

Cisco Employee

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

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

Beginner

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

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

 

I highly appreciate your help guys. :)

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards