Kron run only once at system-startup

Unanswered Question
Oct 27th, 2009
User Badges:

My problem: When a router with a cellulair interface or only the cellular card is replaced in the field this means restoring the saved configuration is not enough to get the box running again, first a few exec commands should be given.


With kron commands in the configuration it is possible to execute exec commands at certain moments or at a certain interval. I want to use this (or another method) to set the cellulair profile settings in the exec mode.


Since 12.4T the kron feauture is extended with the possibility to run on system startup, in addition to the recurring or oneshot occurrences.


Configuring the settings from kron works great, after a reboot of the box the settings are restored. But there is one problem. I only get it to work in a recurring kron schedule. This means that after a reload the commands are directly executed and then in every x minutes, days etc. I don't want this behaviour because this will lead to connectivity loss. The maximum intervall I can choose is 365 days which is far from infinite or never :-)


The manual tell's the format of the cron schedule command is:

kron occurrence occurrence-name [user username] {in [[numdays:] numhours:] nummin | at hours:min [[month] day-of-month] [day-of-week]} {oneshot | recurring | system-startup}


When using "at" the system startup option is not available, when using "in" the maximum time is only 365 days and i can not use a value of 0. Using oneshot will delete the schedule after once running, so next when a config is saved by someone the command is removed from the startup-config. So it seems there is no way to run a exec command only once at every startup with kron. So this is directly a feature request. Solutions: exept 0 for no repeating, except very high values above 365 days or except kron schedules without "in" or "at" (this should in fact already work as it is described in the release notes).


Last but not least, are there any other smart way's to set the cellular profile settings and keep these in the startup-configuration.


My routers don't support EEM, TCL is not handy because of the external storage (flash/tftp). Chat scripts don't seem to work as needed, it looks like executing the cellular profile commands do more than only the chat script commands. Are there any other tricks to solve this deadlock?


Best,


Janno Schouwenburg

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
UgoStorti66 Thu, 11/17/2016 - 09:44
User Badges:

is a bug ( you can change ios or ...)

https://quickview.cloudapps.cisco.com/quickview/bug/CSCsz57283

it works like oneshot

"If a policy list is scheduled to run only once, it will not be displayed by the show running-config command after it has run."

----

kron occurrence remain

kron policy-list is removed in  running config but not in startup config

----

Workaround

reboot at time x ( at 19:00 ?? ): startup config is reladed

http://www.onelumen.com/schedule-daily-restart-of-a-cisco-router/

Enter configuration commands, one per line. End with CNTL/Z.
routerl(config)#kron policy-list reload-router
routerl(config-kron-policy)#cli reload
router(config-kron-policy)#exit
router(config)#kron occurrence reload-router at 4:00 recurring
router(config-kron-occurrence)#policy-list reload-router
router(config-kron-occurrence)#exit
router(config)#exit
router#wr

---

conf t
kron policy-list reload-router
cli reload
exit


kron occurrence reload-router at 4:00 recurring
policy-list reload-router
exit
exit
wr

Actions

This Discussion