On Mon, Nov 13, 2000 at 12:23:21PM -0600, dopp at acm.cs.umn.edu wrote:
> On Mon, Nov 13, 2000 at 11:46:17AM -0600, Kent Schumacher wrote:
> > I typically string 3 or four servers coupled by &&'s in case one of
> > the servers is down.  For example...
> > 
> > ntpdate time.nist.gov && ntpdate for.a.good.time.call.gov && ntpdate time.enough.org
> > 
> I don't think this makes any sense.  The second expression only procedes if
> the first expression returns true.  So, in order for this entire expression
> to finish, each one of the sub-expressions must exit normally.  So, you're
> just setting your time 3 times and if first expression fails, your
> time doesn't get set at all.  
> 
> Or, I could be completely wrong about the behavior of &&.  It seems to me
> that you'd want to be using some sort of logical OR here (maybe ||, but
> I'm not sure if that's a valid operator in shell).

You are correct and || is valid (easy test: `false || echo "OR is valid"`).

However, ntp/ntpdate has a better way of doing this:

ntpdate time.nist.gov for.a.good.time.call.gov time.enough.org

This will cause ntpdate to query all three servers, determine which one(s)
look reliable (if any server is off by huge amounts from the others or from
the local clock, ntp will declare it insane and ignore it), and produce a
much, much more reliable time than if you query each one in sequence.

-- 
"Two words: Windows survives." - Craig Mundie, Microsoft senior strategist
"So does syphillis. Good thing we have penicillin." - Matthew Alton
Geek Code 3.1:  GCS d- s+: a- C++ UL++$ P+>+++ L+++>++++ E- W--(++) N+ o+
!K w---$ O M- V? PS+ PE Y+ PGP t 5++ X+ R++ tv b+ DI++++ D G e* h+ r++ y+