yo8192 / fcron

fcron is an advanced cron for Linux/Unix systems
http://fcron.free.fr
GNU General Public License v2.0
136 stars 12 forks source link

I have an issue with --savetime option. #8

Closed crocket closed 3 years ago

crocket commented 3 years ago

It seems that fcron saves fcrontabs regularly. Thus, write cycles are wasted without a good reason. Is it possible to disable this?

yo8192 commented 3 years ago

Hi,

fcron saves fcrontab regularly to record the states of the jobs, e.g. for @-jobs how long of system run time is left before the next execution. You can use fcron's option '--savetime' to change how often it does it, the less often fcron saves this the more out of date will the state be if your host crashes. If you really wanted to (which I don't recommend), you could '--savetime' to a big value to more or less disable these saves.

crocket commented 3 years ago

I don't understand how fcron works. Does it save job states in crontab files?

yo8192 commented 3 years ago

It keeps the text file form of the fcrontabs, but it also saves a binary form including state information. e.g. in your spool dir, if you have a system fcrontab, you'll see: /usr/local/var/spool/fcron/systab: data -> that's the one with state, saved every savetime seconds /usr/local/var/spool/fcron/systab.orig: ASCII text -> that's the original textual form, which doesn't need to be saved over and over again.

crocket commented 3 years ago

Is it possible to separate static crontabs from state files into separate directories? I want to put state files in tmpfs for microSD cards.

yo8192 commented 3 years ago

No there is no such feature. Having the state file on tmpfs would be of limited value. I think you'd be better of using '--savetime' to save them less often. (as a side note, typically binary fcrontab will be rather small, e.g. can be less than 1KB, by default written once every half an hour. I suspect it would only have a minuscule impact on the lifetime of a typical consumer-grade SD card. All that to say: unless you have very specific constraint, I am not sure these writes should be a problem at all...).