Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Difficulties to acchieve a certain time period with fcron
Date: Sat, 30 May 2015 07:58:00
Message-Id: 55696D7C.8030800@gmail.com
In Reply to: [gentoo-user] Difficulties to acchieve a certain time period with fcron by Meino.Cramer@gmx.de
1 On 29/05/2015 18:12, Meino.Cramer@×××.de wrote:
2 > Hi,
3 >
4 > probably I have made a knot into my brain...
5 >
6 > What I want is, that fcron executes a script every 14 days. It does
7 > not matter, when to execute the script, since I cannot guarantee that
8 > my PC is running exactly at that time.
9 >
10 > I tried
11 >
12 > &b(1),mailto(root) * * */14 * * /home/user/bin/script.sh
13 >
14 > Which "works" according to this: On the 28.th the script was
15 > executed every miinute...
16 >
17 > But: If I specivy anything for the minute/hour field, it means:
18 > Do execute the script exeactly THEN. And this in turn I dont want.
19 >
20 > Which places my thoughts again right at the beginning of the cyclus...
21 >
22 > I am makeing definetly something very wrong here...but I the logic
23 > seems to prevent me to do the rigth ting...
24 >
25 > Or I am currently struck with blindness??
26
27
28
29 Sounds like a job for anacron. What you want to do is way outside what
30 the various cron daemons were built to do.
31
32 Here's how I would do it:
33
34 Run a wrapper script once a day (you do not care when exactly). The
35 wrapper script creates a state file every time it runs the job the says
36 when it last ran. Each time the script starts, it checks this file and
37 figures out itself if it needs to run now or not.
38
39
40 --
41 Alan McKinnon
42 alan.mckinnon@×××××.com

Replies

Subject Author
[gentoo-user] Re: Difficulties to acchieve a certain time period with fcron James <wireless@×××××××××××.com>