Set / Sync NTP / HWClock on Enterprise Linux (RH/OEL)

Another one of my public notes,

#First Configure your ntp servers for the ntp daemon.
vim /etc/ntp.conf

#Chose the options that are going to work best in your case
#We usualy remove the local clock entry and add two new ntp servers
#Add your local / remote ntp server like this.
#server [server address, either hostname or ip] 
server #or
server hostname.domain.ext
#save the settings.

#next check if the ntp daemon is started during system startup for all levels
#that enable networking (235)
chkconfig --list ntpd
ntpd            0:off   1:off   <strong>2:on    3:on</strong>    4:off    <strong>5:on</strong>    6:off

#If ness. add the ntpd daemon to the required levels using;
chkconfig --level 235 ntpd on

#Next sync the system clock with the ntp daemon. BE CAREFULL BEFORE APPYING!
#If the NTP servers time is in the PAST, this step might cause problems when forced
#Readup on ntp how to solve this situation. (yes there is a way šŸ˜‰  )
ntpdate #You own addres naturally

#Next enable the ntp daemon to take over the sync task.
service ntpd start #or
/etc/init.d/ntpd start

#To wrap it all up, its nice to sync the hardware clock as well using this step.
hwclock --systohc   (read 'System to Hardwareclock')

#in case you need to manually set the timezone correctly
#You might create the correct link from the 
#usr/share/zoneinfo/?/? to the /etc/localtime Like this
ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime

#Hope this helps you as much as it helped me in the past
#Check to see if the NTPd is working can be done
#using the following command

One thought on “Set / Sync NTP / HWClock on Enterprise Linux (RH/OEL)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s