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

Re: cron on a system without a hardware persistant clock



On Wed, 28 Sep 2011 10:08:27 +0100, David Goodenough wrote:

> On Tuesday 27 Sep 2011, Camaleón wrote:
>> On Tue, 27 Sep 2011 10:11:33 +0100, David Goodenough wrote:
>> > I have some small single board systems on which I run Debian. They
>> > have clocks, but they are not battery backed and so reset to zero for
>> > each run.
>> 
>> You mean that system always starts with no date set? :-o
> Absolutely yes, that is my problem.  No battery backup for the time when
> the box is powered down, so on boot the time is always the 1st Jan 1970
> 00:00am.

(...)

Can you point us to that piece of hardware? 

Maybe you can consier in adding an RTC (if not present in motherboard) or 
an external battery to get a clock at booting, if not atomically synced, 
at least with "decent" values.

>> Having a system configured with bad time may experience stability
>> issues as most of the base scripts rely on the right time to run their
>> jobs by means of cron and/or other scheduler daemons.
> which is why I want to disable the cron type activities until I have set
> the time/date to a real one.

I don't think that's the right way to deal with this.

In order of importance:

1. Setting up the clock
2. Run cron
3. Run the scripts that depend on cron (system oriented)
4. The rest of the scheduled tasks/jobs (user oriented)

So I would try to add a reliable source (dial-up or GSM modem...) from 
where to sync the time or at least to use it as a backup source from 
where to gather the data if wifi fails or is off for whataever reason.

Greetings,

-- 
Camaleón


Reply to: