Montag, 6. April 2009

EN - kron to backup configuration automatically

A few days ago a came across a nice little question. "Can We do an automatic backup from a config of a router to a tftp server"
Well "Yes we can" (sorry i couldn´t resist)
The key is the kron command


configure terminal
kron policy-list SaveCFG
show run | redirect tftp://"yourTFTPServerIP"/backup.cfg
!
! We´ve got to use Show run + |
! because Kron does not support interactive commands like copy
!
kron occurrence SaveCFG atjavascript:void(0) 00:00 mon recurring
!
! this causes the kron job to run every monday at 0:00
!
policy SaveCFG


You can verify if your kron job is working with a

show kron schedule

and get the response

SaveCFG inactive, will run again in 4 days 12:59:58 at 0 :00 on Mon

A well you can debug it too with:

debug kron all

an you should see what happens when you create change or try to execute a kron policy.

Kron is not working on a ASA/ PIX and AFAIK their is no substitute command for the same task.

cheers NWG

Keine Kommentare:

Kommentar veröffentlichen