Powered by NetBSD

Monday 10 September 2012

Updating the time via NTP

Keeping the time and date up-to-date on a system is quite crucial. To update the time via a NTP Server on NetBSD 5.2.1. MacPPC follow the following steps. 

Edit the file /etc/rc.conf and add the following line to it:
ntpdate=YES ntpdate_hosts="pool.ntp.org"

This will set the time sever to "pool.ntp.org". Next exit vi using :wq!
Nest create a symlink to your local time zone by typing the following command. This example will set the time for Eastern Time in Canada.
ln -fs /usr/share/zoneinfo/Canada/Eastern /etc/localtime
Next restart the NTP service by typing in the following command.
sh /etc/rc.d/rtclocaltime restart
This will cause the system to update the time when the system is connected to the internet. If you want to manually update the time type in the following command and it will update the time.
/usr/sbin/ntpdate -s -b pool.ntp.org
Now type in the date command to see if it has updated the system.

No comments:

Post a Comment