cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
664
Views
0
Helpful
5
Replies

Writing a kron job to run ntp commands after reboot

leam2
Level 1
Level 1

Hello,

I am trying to schedule the task of running the four ntp commands below, after the router (Cisco 887VA) has rebooted, using kron.
Here is my try:

router_887va(config)# kron policy-list kron_ntp
router_887va(config-kron-policy)# cli ntp server 0.pool.ntp.org
router_887va(config-kron-policy)# cli ntp server 1.pool.ntp.org
router_887va(config-kron-policy)# cli ntp server 2.pool.ntp.org
router_887va(config-kron-policy)# cli ntp server 3.pool.ntp.org
router_887va(config-kron-policy)# exit

To test this, I'll just wait for 1 minute:

router_887va(config)# kron occurrence kron_day in 0:0:1 recurring
router_887va(config-kron-occurrence)# policy-list kron_ntp
router_887va(config-kron-occurrence)# exi

Until now, I can see the countdown using the command "show kron schedule" but no "ntp server X.pool.ntp.org" lines get written to the running-config...

What am I doing wrong?

Best regards.

5 Replies 5

I dont know but I think you need to add system-startup after recurring <<-

Hi. Thank you.

Adding system-startup after recurring doesn't change anything.
Moreover, these commands should be run after we are absolutely sure the router has completely started up, I mean, not too soon...

Best regards.

OK you reboot, the router will load statup config and feed to running config 
now runing config have Knor and apply after time you specify, if you not add it to startup the config will no load when router reboot!
or I am wrong ?

Hi.

I currently have this in running-config and startup-config:

 

kron occurrence kron_occurrence_day in 1 recurring
policy-list kron_policy_ntp
!
kron policy-list kron_policy_ntp
cli ntp server 0.pool.ntp.org

 

I reloaded the router.
Below is what happens. It looks like the command is executed but in fact it is not.

 

router_887va# show ntp status
%NTP is not enabled.

router_887va# show kron schedule
Kron Occurrence Schedule
kron_occurrence_iode_day inactive, will run again in 0 days 00:00:08

router_887va# show kron schedule
Kron Occurrence Schedule
kron_occurrence_iode_day inactive, will run again in 0 days 00:00:04

router_887va# show kron schedule
Kron Occurrence Schedule
kron_occurrence_iode_day inactive, will run again in 0 days 00:00:02

router_887va# show kron schedule
Kron Occurrence Schedule
kron_occurrence_iode_day inactive, will run again in 0 days 00:00:01

router_887va# show kron schedule
Kron Occurrence Schedule
kron_occurrence_iode_day inactive, will run again in 0 days 00:00:00

router_887va# show kron schedule
Kron Occurrence Schedule
kron_occurrence_iode_day inactive, will run again in 0 days 00:00:58

router_887va# show ntp status
%NTP is not enabled.

 

Best regards.

Change NTP to SNTP.