[PLUG] Running ntpdate at boot

Denis Heidtmann denis.heidtmann at gmail.com
Sun Nov 29 06:04:50 UTC 2009


On Sat, Nov 28, 2009 at 9:03 PM, wes <plug at the-wes.com> wrote:
>>
>> So the question in its most general form is how to run ntpdate -bu
>> pool.ntp.org without my intervention.  If my attempts at this are
>> close, what does it take to get ntpdate-debian to run during boot?
>> Some of the docs seem to indicate that should be a default condition
>> of ubuntu Jaunty.
>>
>> Thanks for the help,
>> -Denis
>>
>
> I don't run it at boot, but I do run it on a schedule. on production boxes,
> I go once an hour. everything else can go once a day or 12 hours or whenever
> you want really.
>
> I do this by adding the command to invoke ntpdate to root's crontab.
>
> run the command "sudo crontab -e"
>
> add the line:
>
> 0 * * * * ntpdate -bu pool.ntp.org #this will run it once an hour, on the
> hour
>
> or:
>
> 0 0 * * * ntpdate -bu pool.ntp.org #this will run it every day at midnight
>
> -wes

Thanks.  I may resort to something like that, but there are a couple
of problems.  First is that my machine is almost never on at midnight.
 The second is that the time servers try to avoid being hit "on the
hour" by everybody.  I would have to find out how to set the time it
is run offset by some arbitrary number of minutes.

Since my machine is off as much as it is on, time updating at boot is
a good choice. That way there is no chance that some random program
will encounter a file with a future time.

-Denis



More information about the PLUG mailing list