Gentoo Archives: gentoo-user

From: James <wireless@×××××××××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Difficulties to acchieve a certain time period with fcron
Date: Sat, 30 May 2015 16:42:59
Message-Id: loom.20150530T182808-891@post.gmane.org
In Reply to: Re: [gentoo-user] Difficulties to acchieve a certain time period with fcron by Alan McKinnon
1 Alan McKinnon <alan.mckinnon <at> gmail.com> writes:
2
3
4 > On 29/05/2015 18:12, Meino.Cramer <at> gmx.de wrote:
5
6 > > I am makeing definetly something very wrong here...but I the logic
7 > > seems to prevent me to do the rigth ting...
8
9 *cron* are limited. You need advanced logic constructs to achieve what you
10 want. Bash is most likely your easiest path.
11
12
13 > Sounds like a job for anacron. What you want to do is way outside what
14 > the various cron daemons were built to do.
15 > Here's how I would do it:
16 > Run a wrapper script once a day (you do not care when exactly). The
17 > wrapper script creates a state file every time it runs the job the says
18 > when it last ran. Each time the script starts, it checks this file and
19 > figures out itself if it needs to run now or not.
20
21
22 All good advice. There are many example scripts about time triggering and
23 counting days to then trigger your desired script. The construct to track
24 elapsed time that I use, is just a simple "accumulator". Once it is full
25 then you trigger your script and zero out the accumulator and start it
26 all over again.... There are many logic constructs that will do what your
27 want. Just hack away!
28
29
30
31 When my mesos work is ready for other, there is a fantastic replacement,
32 call chronos [1] that will fit your needs nicely. Fortunately for embedded
33 guys like yourself, you'll be able to keep your cluster 'live' on milliwatts
34 of power on a small embedded board, then trigger relays or such to boot up
35 other boxes, as the cluster (down to a minimal embedded board) ramps ups to
36 server your needs. I'm making lots of progress; but the more I get working
37 the more I discover that I need other codes and modules.....
38
39 Maybe you can run the aforementioned anacron on one of your arm boards,
40 for now?
41
42
43 Maybe if you wrote your script in Haskell [2], one of the really smart guys
44 would help you debug and get it working (correctly?).....
45
46 Have Fun,
47 James
48
49
50 [1] http://nerds.airbnb.com/introducing-chronos/
51
52 [2] http://www.haskellforall.com/2015/01/use-haskell-for-shell-scripting.html

Replies

Subject Author
Re: [gentoo-user] Re: Difficulties to acchieve a certain time period with fcron Neil Bothwick <neil@××××××××××.uk>