Operating System - HP-UX
1835913 Members
2911 Online
110087 Solutions
New Discussion

Question on ntp setting & ntpdate usage

 
Kenneth Leung_2
Frequent Advisor

Question on ntp setting & ntpdate usage

My boss gave me 2 time server IP & ask me to set a hourly cron job to use ntpdate to update the time.......Can anyone teach me the setup?? Pls help
4 REPLIES 4
Warren_9
Honored Contributor

Re: Question on ntp setting & ntpdate usage

hi,

add the following in the cron of root.

00 * * * * /usr/sbin/ntpdate -b [server name]

GOOD LUCK!!
A. Clay Stephenson
Acclaimed Contributor

Re: Question on ntp setting & ntpdate usage

Now go get a baseball bat and hit your boss -- hourly. The far better solution is to properly setup your box as an NTP client and it will poll the time servers on as needed basis and will easily maintain time accurately to a few tens of milliseconds and probably much better than that. If you are unfamiliar with NTP then use SAM to set it up and start the service. There is an excellent starter document already on use box -- /usr/share/doc/NTP_Primer.txt. I suggest that you find a minimum of three NTP servers and xntpd itself will determine the "goodness" of them.
If it ain't broke, I can fix that.
Kenneth Leung_2
Frequent Advisor

Re: Question on ntp setting & ntpdate usage

Thanks a lot for the help. BTW...how to check the timezone for the server??? Thanks
Nguyen Anh Tien
Honored Contributor

Re: Question on ntp setting & ntpdate usage

1,use
#crontab -e
to add following line

00 * * * * /usr/sbin/ntpdate -b server name
save and exit
2, check timezone of local server
#cat /etc/TIMEZONE. You can check on server if you have permission to access this file
HTH
ps: pls assign points.
tienna

HP is simple