cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
19111
Views
42
Helpful
11
Replies

Copy to running without confirmation

mbarbero
Level 1
Level 1

Anyone know it there is a way to run this command: copy test.txt running-config

without have to confirm after that the destination file is realy the running-config?

I'm needing this why?

I need to schedule a shut, no shut in voice-ports.

The way I found to do this is:

Create the flash:test.txt file with:

voice-port 1/0

sh

no sh

voice-port 0/0

sh

no sh

Create a kron schedule as:

kron policy-list DROPCALL

cli copy test.txt running-config

kron occurrence DROP at 19:57 oneshot

policy-list DROPCALL

END

The problem is that the copy command need a confirmation, so it doesn't work.

If there is a way to disable the confirmation it should works.

Or, someone knows how to accomplish that in another way?

regards

11 Replies 11

vashdevt
Level 1
Level 1

Hi,

you can use the TERA TERM

http://hp.vector.co.jp/authors/VA002416/ttermp23.zip and make script like

connect '10.0.0.1'

;wait for password prompt

wait 'Password: '

sendln 'mypassword'

wait '>'

sendln 'enable'

wait 'Password: '

sendln 'mypassword'

wait 'myrouter#'

sendln 'copy running-config tftp:'

wait '[]?'

sendln 'Tftp-ip-address'

wait ']?'

sendln 'config.txt'

wait 'myrouter#'

Sendln 'exit'

Vash

This should work but I need an external machine to do that.

My objective is schedule the router itself to do that.

Anyone know how to do that?

Would the 'KRON' command for your respective IOS version be something helpful? Do a search at the home page for "KRON" or "IOS Command Scheduler".

Let us know if it helped.

Depending on your IOS version, I believe you can do this with tcl (tool control language, frequently distributed as tcl/tk).

I think I've read that tcl is enabled on the more recent IOS versions. By using tcl, you are running it as a background process, not from the prompt as other scripting would do.

Here's a list of links from the main Cisco site:

http://www.cisco.com/pcgi-bin/search/search.pl?searchPhrase=tcl&x=0&y=0&nv=Search+All+cisco.com%23%23cisco.com&nv=Technical+Support+%26+documentation%23%23cisco.com%23TSD&language=en&country=US&accessLevel=Guest&siteToSearch=cisco.com

If it is available, there are a bunch of learning/"how to" books available. Copying a file should be fairly trivial and shouldn't load the router CPU too much.

Good Luck

Scott

bover
Level 1
Level 1

I'm glad someone else has asked this question. I'm trying to set up a kron job that will ftp a copy of a running-config up to an FTP server on a nightly basis but it keeps failing out due to the prompt on the copy command.

Is there any setting or flag I can use on the cli command to remove the prompt for name of remote host and destination filename?

to do that you have to issue the command:

router(config)#file prompt quiet

So the router will not ask for confirmation on any flash file system operation.

That worked! Thank you very much. I searched CCO for days looking for a solution. I love these forums. :)

Thank you very much!  This worked for me as well when trying to create new file directories with an automated tool.

Hi,
This works for IOS device but this doesn't work for IOS-XR devices, can you please let me know if similar kind of command is available in IOS-XR device to achieve the use case where I am trying to `copy running-config` in a file.

Thanks

shellhammer
Level 1
Level 1

I'm having a similar issue using KRON.

I have been trying to use:

write network tftp://

write does not require a prompt, but 12.2(25r)SEC is forcing the change back to copy. Is write going away??

 
Review Cisco Networking for a $25 gift card