1 INFO-VAX	Sun, 27 Jun 2004	Volume 2004 : Issue 354       Contents: Re: NTP and NTPDATE   F ----------------------------------------------------------------------  % Date: Sun, 27 Jun 2004 10:33:19 +0300 4 From: Mike Rechtman <michael.rechtman.nospam@hp.com> Subject: Re: NTP and NTPDATE& Message-ID: <40DEA26F.391A16AC@hp.com>   Louie wrote: > K > Running UCX version 4.2 with NTP as a client on a Alpha 2100 with OpenVMS L > 7.1. Everything is fine until the server time jumps by more than 7.5 hoursC > following a powerdown or power blip. Then NTP won't set the time.  > M > Is there a NTPDATE program available for this version of UCX that I can run   > from a COM script during boot? > 4 > Or maybe a way to configure NTP to reset the date? > L > Upgrading to TCP/IP version 5.0 is not an option because it will break the1 > software that is relying on FTP in version 4.2.  >  > Thanks in advance  > Louie.  A The following is something I use to set the _approximate_ time at  startup,# so that NTP can take it from there. 5 Unsupported, but works for me (run once at startup):     -----<start code>-----   $       Type SYS$INPUT    @         This program and any program with which it cooperates or	 exchanges G         information and/or which has been either written or modified by H         the undersigned is not warranted in any manner, shape or form to          perform any useful task.)         It is guaranteed to contain bugs. D         Its use and the interpretation of any results is left solely6         to the discretion and imagination of the user.5         No claims are made or implied by its release. C         Any distribution of any such program MUST include the above  notice.   =                                                Mike Rechtman,  31-Dec-2001  $  $! $ vf_ = f$verify(0) / $ ds = f$trnlnm("SYS$TIMEZONE_DAYLIGHT_SAVING")  $ if (ds .nes. "") $ then/ $       if ((ds .eqs. "0") .or. (ds .eqs. "1"))  $       thenD $               d = f$integer(f$trnlnm("SYS$TIMEZONE_DIFFERENTIAL")) $               sign = "+" $               if (d .lt. 0 ) $               then" $                       sign = "-"! $                       d = 0 - d  $               endif  $               d = d / 3600B $               diff = "''sign'''d':00:00"      ! whole hours only $       else" $               write sys$output -9 			"Illegal value ''d_s' in SYS$TIMEZONE_DAYLIGHT_SAVING"  $               exit
 $       endif  $ elseE $       diff = "+02:00:00"                      ! Standard local time  $ endif  $! $ a1 = f$cvtime("",,"DAY") $ a2 = f$cvtime("",,"MONTH")* $ a3 = f$extract(2,2,f$cvtime("",,"YEAR")) $ today = "''a3'-''a2'-''a1'"  $ now = f$cvtime("",,"TIME") $ mess1 = f$envir("MESSAGE") $ set message/nof/noi/nos/not  $ on error then goto oops 8 $ define/user sys$input  TT:	! for BATCH change to OPA0:C $ define/user sys$output  TT:	! must be an existing terminal device  $ define/user sys$command TT: @ $ telnet time-b.timefreq.bldrdoc.gov  /port=13/log=show_time.tmp
 $ set noon $ set message 'mess1) $ open/read/error=oops tmp show_time.tmp;  $ read/error=oops tmp line $ date = f$elem(1," ",line)  $ utc_time = f$elem(2," ",line) / $ time = f$cvtime("''utc_time'''diff'",,"TIME") H $ write sys$output "here: ''today':''now'      UTC: ''date':''utc_time'" $ if (date .eqs. today) then -       set time='time( $ write sys$output "Time set to ''time'" $oops: $ st = $STATUS $ close tmp  $ dele show_time.tmp;* $ set message 'mess1 $ vf_ = f$verify(vf_) 	 $ exit st  $! ----<end code>----     --  E --------------------------------------------------------------------- E Usual disclaimer: All opinions are mine alone, perhaps not even that. ? Mike Rechtman                            *rechtman@tzora.co.il* F Kibbutz Tzor'a.                          Voice (home): 972-2-9908337  B   "20% of a job takes 80% of the time, the rest takes another 80%"E ---------------------------------------------------------------------  -----BEGIN GEEK CODE BLOCK-----  Version: 3.1: GCM/CS d(-)pu s:+>:- a++ C++ U-- L-- W++ N++ K? w--- V+++$6 PS+ PE-- t 5? X- tv-- b+ DI+ D-- G e++ h--- r+++ y+++@ ------END GEEK CODE BLOCK------    ------------------------------   End of INFO-VAX 2004.354 ************************