FreeBSD开机自动同步时间。

最近把VPS系统换成了FreeBSD,发现每次重启之后时间都会不正确,使用以下的方法可以让FreeBSD在开机的时候自动使用NTP来校对时间。

编辑 /etc/rc.conf 加入以下代码:

ntpdate_enable="YES" # Run ntpdate to sync time on boot (or NO). 
ntpdate_program="ntpdate" # path to ntpdate, if you want a different one. 
ntpdate_flags="us.pool.ntp.org" # Flags to ntpdate (if enabled).