cancel
Showing results for 
Search instead for 
Did you mean: 

synchronize time

f. halili
Trusted Contributor

synchronize time

What are the ways to synchronize the time on my Linux workstation against an HP server ??? Thanks..

5 REPLIES
Albert E. Whale, CISSP
Honored Contributor

Re: synchronize time

Have you considered using the ntp daemons?

I use the Network Time Protocol to establish a Pool of Time servers and then allocate the time synching to the machines which need it.

NTP is alvailable on both HP-UX (9, 10, 11) and all varieties of Linux.

Hope that helps, if not get back to me and I be glad to assit you further.

Have a Great Day!
Sr. Systems Consultant @ ABS Computer Technology, Inc. http://www.abs-comptech.com/aewhale.html & http://www.ancegroup.com
f. halili
Trusted Contributor

Re: synchronize time

any docs/procedure to do this on linux????
Tim Malnati
Honored Contributor

Re: synchronize time

It's actually very easy on a linux box. First you need to install the ntp package for your particular flavor of linux if it is not already installed. Most of the linux distributions already have it ported. If it's installed, you should have /etc/ntp.conf present.

In ntp.conf, comment out the two lines:

# server 127.127.1.0 # local clock
# fudge 127.127.1.0 stratum 10

Then you need to add two (or more) server lines to some time standard machines on the internet. Something like:

server 199.240.130.1 # kansasnet npt1
server 199.240.130.12 # kansasnet npt2

The server IP addresses should be taken from the list at http://www.eecis.udel.edu/~mills/ntp/clock2.htm This is a list of stratum 2 servers located around the world. Stratum 2 is more than adequate for a single workstation. Track up this website and you will have more information that you ever wanted on how ntp works. If you have DNS running on your machine, you can use the address name instead.

I would also add a line to log the output like:

logfile /var/log/ntp

At this point you are configured. So now you need a method of starting and stopping the daemon. I suggest you create a file in /etc/rc.d/init.d called ntpd to do this work for you. There is a good chance that it is already there for your distribution, but I've attached a copy used in Redhat 7.0. Now you need to add the appropriate startup/kill links in /etc/rc.d/rc0.d thru /etc/rc.d/rc6.d. It should be started some time after DNS is started and can be killed just about anywhere in the shutdown sequence. Your done.

There are lots of other options you can add, but what you have here will get you up and running.
Albert E. Whale, CISSP
Honored Contributor

Re: synchronize time

In case you didn't know, there is a wealth of information available to you on your Linux Server (most of it can be directly applied to your HP Environment as well!), check out the information in the /usr/doc directory.

I found an entire directory devoted to ntp under the /usr/doc/xntp3-5.93/index.html

Some of the files in this tree are text, some are HTML.

Hope that helps.

Have a Great Day!
Sr. Systems Consultant @ ABS Computer Technology, Inc. http://www.abs-comptech.com/aewhale.html & http://www.ancegroup.com
tony j. podrasky
Valued Contributor

Re: synchronize time

If you want to create your own master time source, you can buy a WWVB receiver from
for around $100. I can E-MAIL you the little program that interrogates it and sets your local LINUX box to the correct time. Then you can use xntpd to dist the time out to the rest of the world.

Here's what I get when I do a telnet to the timeport on my other machines:

tonyp%
tonyp% NETTIME

Connected to localhost.
Thu Jan 4 10:41:59 2001

Connected to m24dptjp.
Thu Jan 4 10:41:59 2001

Connected to m24dprjb.
Thu Jan 4 10:41:59 2001

Connected to m24dps1t.
Thu Jan 4 10:41:59 2001


regards,
tonyp
REMEMBER: Once you eliminate your #1 problem, #2 gets a promotion.