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

Re: cron on a system without a hardware persistant clock

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

> I then set the time using NTP once I have a network connection -
> wireless as it happens and therefore not entirely predictable in how
> quickly it will connect.

Mmm... I would be careful with this, NTP may refuse to sync if the offset 
between current/real date and system date is too wide.

> I would like to make sure that cron (and I am quite happy to looks at
> other crons if that makes like easy) does not use an unset clock as the
> basis for firing commands.

There are also "/etc/cron.hourly|daily|weekly" folders where you can put 
your scripts which will be run by cron at no "specific" time, not sure if 
this can be useful to your purpose or you seek instead for a system wide 
solution to your timing issues.
> I could use update-rc.d to disable cron, and only enable it once
> wpa_supplicant has established the connection, but then what if the
> wireless link goes down and back up while the hardware is powered up, in
> which case it would get restarted unnecessarily.
> Does anyone know if there is a way to tell and of the crons to ignore
> unset times?

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.



Reply to: