[ntp:questions] sntp output for bootstrapping system time

Christopher Nelson cnelson at nycap.rr.com
Mon Nov 21 21:30:02 UTC 2005


The SNTP README says:

   WARNING: adjtime is more than a bit sick on many systems, and will
   ignore large corrections, usually without any form of hint that it
   has done so.  It is often (even usually) necessary to reset the
   clock to approximately the right time using the -r option before
   using the -a and -x options to keep it correct.

I tried

  sntp -r ntp.mydomain.com

and it prompted me about the big difference then ignored me when I said
Y to the prompt.

So I tried to do something like:

   # Get the approximate date
   date -s `sntp ntp.mydomain.com | somefilter`
   # Fix it up with NTP
   sntp ntp.mydomain.com

but I'm having trouble coming up with filter that massages sntp output
to date input without what seems to be undue complexity.  Is there
something I'm missing?  Is there an SNTP option to generate output
compatible with date?




More information about the questions mailing list