RE: Cron and Summer/winter time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux