Kron policy lost after execution

I don’t know if I’m posting in the correct place

i created a tcl script this is run by kron (kron occurrance shutdown at 00:35 recurring)
but after kron runs the script i can’t find the kron policy-list anymore

thanks for any help

Hello Giovanni

In order to help you further, we will need some more information. Can you share with us your configuration? In the meantime, take a look at this documentation that may help you out in your troubleshooting.

I hope this has been helpful!

Laz

I am attaching the kron configuration on switch 2960 version
c2960-lanbasek9-mz.150-2.SE11.bin

kron occurrence shut in 1 recurring
  policy-list shut
!
kron policy-list  shut
  cli tclsh flash: /10.tcl noshut

the script runs successfully the first time
if you go to see the running config the kron policie-list is removed
see running afther first execution

!
kron occurrence shut in 1 recurring
  policy-list shut

it doesn’t seem normal to me (bug !!!)

Hello Giovanni

After doing some research, I have found that others have had similar behavior in their implementations as well. The following links depict some of these situations, including an actual Cisco bug (although the bug is for a different IOS version).

A workaround that may be helpful is to include a CLI command in your script that writes the running config to the startup config. This was one solution that I saw, although you should try it out to confirm.

Alternatively, I suggest you use an EEM script, which is generally preferred over using kron. Anything that can be achieved with kron can also be done with EEM since it is considered a superset of kron, at least in capabilities.

Let us know how you get along, and if we can be of any more help.

I hope this has been helpful!

Laz

1 Like