On 29/05/2015 18:12, meino.cra...@gmx.de wrote:
> Hi,
> 
> probably I have made a knot into my brain...
> 
> What I want is, that fcron executes a script every 14 days. It does
> not matter, when to execute the script, since I cannot guarantee that
> my PC is running exactly at that time.
> 
> I tried
> 
> &b(1),mailto(root) * * */14 * * /home/user/bin/script.sh
> 
> Which "works" according to this: On the 28.th the script was
> executed every miinute...
> 
> But: If I specivy anything for the minute/hour field, it means:
> Do execute the script exeactly THEN. And this in turn I dont want.
> 
> Which places my thoughts again right at the beginning of the cyclus...
> 
> I am makeing definetly something very wrong here...but I the logic
> seems to prevent me to do the rigth ting...
> 
> Or I am currently struck with blindness??



Sounds like a job for anacron. What you want to do is way outside what
the various cron daemons were built to do.

Here's how I would do it:

Run a wrapper script once a day (you do not care when exactly). The
wrapper script creates a state file every time it runs the job the says
when it last ran. Each time the script starts, it checks this file and
figures out itself if it needs to run now or not.


-- 
Alan McKinnon
alan.mckin...@gmail.com


Reply via email to