08-30-2018 09:49 PM
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.
Solved! Go to Solution.
08-30-2018 10:02 PM
08-30-2018 10:44 PM
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
08-30-2018 10:02 PM
You can try "show run | file disk0:show_run"
Thanks,
Santosh
08-30-2018 10:17 PM
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.
08-30-2018 10:30 PM
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
#
08-30-2018 10:32 PM
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
#
08-30-2018 10:44 PM
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
08-30-2018 10:48 PM
I am able to resolve my issue Thanks, Santosh and Ashish for the quick resolution.
I highly appreciate your help guys. :)
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