Running ntpdate from cron.daily

Colin Law clanlaw at googlemail.com
Mon Jul 18 06:20:43 UTC 2011


On 17 July 2011 23:33, Stephen Kuhn <yank.down.under at gmx.com> wrote:
> On Sun, 2011-07-17 at 09:38 +0100, Colin Law wrote:
>> In order to keep the SheevaPlug that controls my weather station time
>> synchronised I followed the instructions in [1] and created a file
>> etc/cron.daily/ntpdate containing
>> ntpdate ntp.ubuntu.com
>> and made it executable.  This did not work and I realised that I
>> needed to start the file with
>> #! /bin/bash
>> and then it worked fine.  Before I go and edit the wiki can someone
>> confirm that I have correctly analysed the problem.
>>
>
> You can set options for ntpdate in the /etc/default/ntpdate file, along
> with the /etc/ntp.conf => this would allow you to not have a script at
> all, and just modify the configurations directly from either of these
> two files; so you'd not need a cron job. HTH.

My question has nothing to do with the ntp daemon ntpd, which I think
is what you are referring to.  The Plug PC only has 512MB ram and a
4GB SD.  I do not wish the overheads of additional disk space, ram or
processor of installing and running ntpd.  Synchronising the clock
daily using ntpdate is sufficient.  My question is merely whether a
script in cron.daily should start with the #! shell line.

Colin




More information about the ubuntu-users mailing list