08-05-2011 08:24 AM - edited 03-07-2019 01:34 AM
I am trying to set up KRON to do a "write mem" and then save the config to my TFTP server. Here is the config I used:
kron policy-list SaveConfig
cli write
exit
kron occurrence SaveConfigSchedule at 23:00 Fri
policy-list SaveConfig
kron policy-list Backup
cli show run | redirect tftp://10.100.100.70/test.cfg
exit
kron occurrence Backup in 3
policy-list Backup
The first portion works well. The second, Backup, does not. I can ping my TFTP server from this router that I am trying this out on. I can even do a "copy run tftp" then answer all the questions and it works just fine. I used the following document from Cisco to configure:
http://www.cisco.com/en/US/products/sw/iosswrel/ps1835/products_tech_note09186a008020260d.shtml
When I do a "debug kron all" it shows that it timed out. I'd like a second set of eyes to look at this and tell me what I am doing wrong.
Mike
08-05-2011 09:30 AM
Hi Mike,
Using the redirect like that is always cumbersome.
Perhaps a better way is to create an alias to perform the write command:
alias exec backup copy run tftp://10.100.100.70/test.cfg
This will (if I remember correctly) requires one additional command:
no prompt
This line is to prevent the tftp command prompting for whatever reason.
Perhaps your version will also work after configuring this rather simple line.
regards,
Leo
08-05-2011 10:59 AM
Hi,
kron commands can't be interactive. If you configure the file prompt quiet configuration command then it should work with the second policy.
Regards.
Alain.
08-05-2011 11:47 AM
Hi Alain,
You are correct, this is the command I meant (but had forgotten)
Five points from me for refreshing my memory.
regards,
Leo
03-24-2017 07:06 AM
Hi Alain,
Can you please help me with the command to get output for multiple show commands in a single text file like show vlan brief, show interface trunk, show ip eigrp neighbor and so on. Thanks.
08-06-2011 11:21 AM
Hi,
it might be easier to use archive config command with path configured to your TFTP server and time-period one week?
See
http://www.cisco.com/en/US/docs/ios/fundamentals/command/reference/cf_a1.html#wp1021238
HTH,
Milan
08-08-2011 08:23 AM
Milan,
Thanks for the archive suggestion. I liked it so I tried it. It too, gave me a problem. I set the path and the time-period. Do I not have the path set correctly. Again, I can ping my TFTP server and even do a copy run tftp with NO problems. Here is what I get:
CRAC#archive config
.....
%Error opening tftp://10.100.100.70/CRAC_Config-1 (Timed out)
08-08-2011 08:41 AM
Hi Mike,
I'm not sure what the problem could be.
Possible your TFTP server is not 100% compatible with Cisco?
I'm using the archive config on my routers with FTP transfer, not TFTP.
And it works without any problem.
I just had to set FTP user/password and source interface in my router config.
I also use archive write-memory instead of time-period but it should make no difference.
BR,
Milan
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