Problem with presistence and cron syntax


(HomeAutomation) #1

I want to write presistence values to rrd4j every 5 minutes.

Settings:
Strategies {
everyMinute : "0 * * * * ?"
every5Minutes : "0 0/5 * * * ?"
everyHour : "0 0 * * * ?"
everyDay : “0 0 0 * * ?”

This one is working:
Temperatur : strategy = everyMinute

I tried this one, but it does not write anything
Temperatur : strategy = every5Minutes

If I use “0 0/5 * * * ?” in a rule it is working as expected, does something every five minutes.

What is going wrong? Is the cron syntax different in rules and presistence?


(Angelos) #2

shouldn’t this be (not sure):

every5Minutes : "0 */5 * * * ?"

(HomeAutomation) #3

In the cron documentation it is written, that this should work.
http://www.quartz-scheduler.org/documentation/quartz-2.1.x/tutorials/crontrigger
This cron syntax x/y tells to run starting at x every y.

I’ve tested it with a rule and the rule was triggered every 5 min starting at minute 0.

I can use every5Minutes : “0 5,15,25,35,45,55 * * * ?” should work, I will check this

your suggestion every5Minutes : “0 */5 * * * ?” has the same syntax that my original one, but I will test it too


(SiHui) #4

I guess you won’t be happy with that, see the docs:

http://docs.openhab.org/addons/persistence/rrd4j/readme.html

All item- and event-related configuration is done in the file persistence/rrd4j.persist. The strategy everyMinute must be used, otherwise no data will be persisted (stored).


(HomeAutomation) #5

ok, now it is clear, that only this will work, thanks.


( ) #6

Also as a small side note: Depending on your goal you might want to hop on to a more powerful persistence solution right from the beginning. See here as an example:


(HomeAutomation) #7

wow, cool, I will test it.


(Michael Sutter) #8

Depending on your goals, a two vendor strategy could be interesting…

MapDB for switches and binary sensors,
Influx dB for values.

Tell us your goals…


(HomeAutomation) #9

This is exactly what I want to do. store presistence in mapdb, store charts in rrd4j or Influx dB