RE: Cron and Summer/winter time




Guys,

I'm sure there is a solution for this:
When I schedule a daily job to run at 1:30 AM and we switch
from Winter to
Summer time, the job doesn't run, because when the clock
reaches 1 AM it's
suddenly 2 AM and 1:30 AM never happens.

The same job would run twice, when we switch back because
when it's 2 AM, it
has already run 30 minutes before, but then it's suddenly 1
AM again and
it'll run again in 30 minutes.

For simple clean-up jobs, this might be acceptable, but when
running more
complex jobs that need to run once and only once per day,
this isn't going to
work too well.

Any ideas?
Chris

1. Try scheduling the job at 12:30AM or 3AM? That way you don't encounter
the hole in summer time at all.
2. Schedule special jobs only for the specific days in which the normal
cron job will be missed (covers the case of missing the job, but not the
case of running it twice).
3. Rework the job so that it sets up a semaphore of some sort upon running,
so that if the cron job fires twice in one day the semaphore will block the
second run. You can do this, depending on the specifics with something as
simple as touching a file. This covers the second-run case.

The problem is that cron is pretty simple and if it doesn't see the specific
runtime, it won't fire a job and if it sees the runtime twice, it fires
twice. As far as I know, this has always been a side-effect of how cron
operates and not something that can be fixed.

Hope this helps! Erik


--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list



Relevant Pages

  • Re: cron
    ... cron job, it is going to be in one of a small number of locations. ... and want to change the schedule. ... What if your daily job needs to be done twice daily? ...
    (Fedora)
  • Alternative Weight Training Splits For Better Gains And Bigger Muscle
    ... There's an old adage that reads, "The best bodybuilding body part ... is a remarkably adaptable machine, ... The other protocol calls for training each body part TWICE ... Create a split, which capitalizes upon your schedule, not one ...
    (uk.rec.bodybuilding)
  • CRON PROBLEMS
    ... I m having problems setting up a cron job on Fedora 11. ... the schedule is supposed to be executed once but it run a number of times ...
    (Fedora)
  • Re: problem with Scheduler at daylight saving time switch
    ... it sounds to me like it did exactly what you asked: to run the task at every 3.00 AM your machine encounters. ... too bad it did encounter this time twice last sunday morning. ... In the properties of that task the Schedule tab has the following: ... Is this a bug in Windows Scheduler? ...
    (microsoft.public.windows.server.general)
  • Re: What sort of fault might this be?
    ... Have used their onling thing twice now. ... or do I have to push the "Schedule a visit" button too? ...
    (uk.telecom.broadband)