Troubleshoot kron command for schedule Backup of devices

Document

Feb 16, 2011 1:48 PM
Feb 16th, 2011

I setup archive feature on our switch stack, thinking it will back up the full running config to an FTP server. The setup works fine when a write-memory is performed - the entire config gets sent to text file on FTP server. When it does a scheduled archive; however, the text file is virtually empty.

Here is the config:

Switch#sh run | beg archive
archive
path ftp://<server-ip>/A06_3750/$h-
write-memory
time-period 1440
!

Every 1440 minutes, my understanding is it would archive the config to the ftp server. Here is the text file it leaves instead:

!

! Last configuration change at 07:04:29 PST Sat Jan 29 2011 by user

! NVRAM config last updated at 06:52:01 PST Sat Jan 29 2011 by user

!

boot-start-marker

boot-end-marker

!

!

!

!

!

!

end

What am I missing here? Do I have to setup a kron job to run the "archive config" EXEC command?

Check out the below link for archive configuration on switches

http://itknowledgeexchange.techtarget.com/network-technologies/how-to-archive-your-cisco-router-or-switch-configuration/

Hope to Help !!

Ganesh.H

Remember to rate the helpful post

Hi Michael,

               use this config

archive  
path tftp://172.16.0.30/INTERNET_ROUTER_BACKUP/$h
write-memory

kron occurrence BACKUP in 15:00:00 recurring
policy-list BACKUP_CONFIG
!      

kron policy-list BACKUP_CONFIG
cli write memory

!

where INTERNET_ROUTER_BACKUP is the backup folder over TFTP server---- and ----- 15:00:00 is every 15 days

sh kron schedule
Kron Occurrence Schedule
BACKUP inactive, will run again in 14 days 23:59:29

HTH

Hi ahmed,

Your kron job will do a copy run start( or wr mem) every  fortnight but will never write the running config to the tftp server.

If you want to do this with a kron job you'll have to issue following command in your kron policy: cli show run | redirect tftp:/172.16.0.30/xxx

But then no more need for the archive command.

Regards.

Alain.

Hi Alain,

              YES you are right  "never write the running config to the tftp server". I knew about this

I was not aware of redirect command.. i tried to configure redirect  and remove archive configuration but it didnot work for me

Check my TFTP server logs.

Write request for file <BACKUP>. Mode octet [15/02 15:36:34.359]
Using local port 1449 [15/02 15:36:34.359]
<BACKUP>: rcvd 0 blk, 0 bytes in 1 s. 0 blk resent [15/02 15:36:35.359]

Thanks & Regards

Ahmed...

Hi,

Can you post output of sh run | be kron and also while kron is active the ouput of debug ip packet 101

where 101 is ACl like this  access-list 101 permit udp host "your router IP" host "your tftp server IP".

Regards.

Alain.

Router#sh run | be kron
kron occurrence BACKUP at 20:45 recurring
policy-list BACKUP
!
kron policy-list BACKUP
cli sh run | redirect tftp://172.16.0.30/TFTP

Feb 15 17:45:59.800: IP: tableid=0, s=172.16.0.1 (local), d=172.16.0.30 (FastEthernet0/0.1), routed via FIB
Feb 15 17:45:59.800: IP: s=172.16.0.1 (local), d=172.16.0.30 (FastEthernet0/0.1), len 41, sending
Feb 15 17:46:02.425: IP: tableid=0, s=172.16.0.1 (local), d=172.16.0.30 (FastEthernet0/0.1), routed via FIB
Feb 15 17:46:02.425: IP: s=172.16.0.1 (local), d=172.16.0.30 (FastEthernet0/0.1), len 544, sending
Feb 15 17:46:05.425: IP: tableid=0, s=172.16.0.1 (local), d=172.16.0.30 (FastEthernet0/0.1), routed via FIB
Feb 15 17:46:05.425: IP: s=172.16.0.1 (local), d=172.16.0.30 (FastEthernet0/0.1), len 544, sending
Feb 15 17:46:09.425: IP: tableid=0, s=172.16.0.1 (local), d=172.16.0.30 (FastEthernet0/0.1), routed via FIB
Feb 15 17:46:09.425: IP: s=172.16.0.1 (local), d=172.16.0.30 (FastEthernet0/0.1), len 544, sending
Feb 15 17:46:14.425: IP: tableid=0, s=172.16.0.1 (local), d=172.16.0.30 (FastEthernet0/0.1), routed via FIB
Feb 15 17:46:14.425: IP: s=172.16.0.1 (local), d=172.16.0.30 (FastEthernet0/0.1), len 544, sending
Feb 15 17:46:20.425: IP: tableid=0, s=172.16.0.1 (local), d=172.16.0.30 (FastEthernet0/0.1), routed via FIB
Feb 15 17:46:20.425: IP: s=172.16.0.1 (local), d=172.16.0.30 (FastEthernet0/0.1), len 544, sending
Feb 15 17:46:27.425: %SYS-3-URLWRITEFAIL: redirection url write failed 'Timed out'

TFTP SERVER LOGS

Connection received from 172.16.0.1 on port 52956 [15/02 20:45:56.078]
Write request for file <TFTP>. Mode octet [15/02 20:45:56.078]
Using local port 1167 [15/02 20:45:56.093]
<TFTP>: rcvd 0 blk, 0 bytes in 1 s. 0 blk resent [15/02 20:45:57.093]

interstingly routers CPU goes up to 70%.

When i tried first time, i crashed my router and had to reconfigure again.

Thanks & Regards

Ahmed...

NOTE:dont look at debug time as i forgot to configure timestamp debug command after restoring my router config

Hi,

Can you try a copy run tftp://172.16.0.30 and if it fails can you sniff with wireshark or another software on the tftp server then send pcap file.

if it's ok then retry the kron and sniff on tftp server.

Regards.

Alain.

Hi Alain,

           copy tftp was successful. but when i ran wireshark over TFTP server while configuring kron on my router, i got unusual error.few lines of my router were being sent to TFTP server repeatedly and i could see TFTP server received it properly but i could see ICMP Destination unreachable (port unreachable ) from TFTP server to router.

Actually in my pcap file which i ran on my server includes all other sensitives information, so i cant share that file here, please check the screenshots of it.

Thanks

hi,

Can you do the same when doing the copy tftp command and then compare the 2 ways to see any difference.

I don't understand why it's working with the copy command and not with the kron policy.

Regards.

Alain.

Hi,

   I pointed out my issue, actually i have configured my NIC of server to be  trunk port (intel VLANs option). when i tried same kron configuration to my notebook it worked as desired.

Thanks for i can use ths command for other devices as well.

This document was generated from the following thread: Archive command not backing up the config

Average Rating: 0 (0 ratings)

Actions

Login or Register to take actions

This Document

Posted February 16, 2011 at 1:48 PM
Stats:
Comments:0 Avg. Rating:0
Views:2565 Contributors:0
Shares:0
Tags: No tags.

Documents Leaderboard

Rank Username Points
1 106
2 20
3 9
4 5
Rank Username Points
15
5