Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

automatic backup issue with kron

Hi all,

Every month I have to issue these commands for backup at my network devices

#show run

#show version

# show diag

now I have around more than 200 network device form routers and switches so I go to automatic backup from cisco by using kron command

I use

# kron policy-list backup

#cli show run | redirect tftp://192.168.10.1/R1-run

#cli show ver | redirect tftp://192.168.10.1/R1-ver

#cli show diag | redirect tftp://192.168.10.1/R1-ver

 

but every command ''must'' have its own file for output ,can I find any solution to make all outputs of these three commands combined in one file automatically by the router

 

BR

Mahmoud

  • Network Management
1 ACCEPTED SOLUTION

Accepted Solutions

Well, there's a short answer

Well, there's a short answer and a long answer.

The short answer is to use "cli show tech-support | redirect tftp://192.168.10.1/R1-tech-support" instead. The output of this command includes all three of the items you're looking for and quite a bit more.

The long answer is to use an EEM script to combine things before sending.

event manager applet EEM_Status
 event timer cron cron-entry "* * 1 * *"
 action 1.0 cli command "enable"
 action 2.0 cli command "delete /force flash:/status"
 action 3.0 cli command "show running-config | redirect flash:/status"
 action 4.0 cli command "show version | append flash:/status"
 action 5.0 cli command "show diag | append flash:/status"
 action 6.0 cli command "copy flash:/status tftp://192.168.10.1/R1-status"
 action 6.0 exit

This script will combine all three commands into a file on the flash called "status" at midnight on the first of each month and then TFTP that file to your server.

4 REPLIES

Well, there's a short answer

Well, there's a short answer and a long answer.

The short answer is to use "cli show tech-support | redirect tftp://192.168.10.1/R1-tech-support" instead. The output of this command includes all three of the items you're looking for and quite a bit more.

The long answer is to use an EEM script to combine things before sending.

event manager applet EEM_Status
 event timer cron cron-entry "* * 1 * *"
 action 1.0 cli command "enable"
 action 2.0 cli command "delete /force flash:/status"
 action 3.0 cli command "show running-config | redirect flash:/status"
 action 4.0 cli command "show version | append flash:/status"
 action 5.0 cli command "show diag | append flash:/status"
 action 6.0 cli command "copy flash:/status tftp://192.168.10.1/R1-status"
 action 6.0 exit

This script will combine all three commands into a file on the flash called "status" at midnight on the first of each month and then TFTP that file to your server.

New Member

Thanks Jody for your replycan

Thanks Jody for your reply

can I customize the output of this command

#cli show tech-support

The "show tech-support"

The "show tech-support" command doesn't have any options, so no. If you want granular control of the output, I would go with the EEM approach.

New Member

I made these commands and it

I made these commands and it worked great

event manager applet backup
 event timer cron cron-entry "45 13 19 10 *"
 action 1.0 cli command "enable"
 action 2.0 cli command "delete /force flash:/status"
 action 3.0 cli command "show running-config | redirect flash:/status"
 action 4.0 cli command "show version | append flash:/status"
 action 5.0 cli command "show diag | append flash:/status"
 action 6.0 cli command "copy flash:/status tftp:" pattern "Address or name of remote host.*"
 action 7.0 cli command "192.168.10.1" pattern "Destination filename.*"
 action 8.0 cli command "R1-status"

130
Views
0
Helpful
4
Replies