Monday, 13 September 2004
On FreeBSD you can use ntptimeset to synchronize your clock. This short article will explain how to configure ntptimeset and show how to set up a cron job to automatically adjust your time. ntptimeset is installed by default on FreeBSD but here are the steps to configure it.1. First we have to create the configuration file. In /etc create a file called ntp.conf. This is the file that you define what servers will be used to sync your time
[root]# cd /etc [root]# vi ntp.conf
The file should look like this
server 192.5.41.41 prefer server 128.4.1.2 server 138.39.7.20 server 128.4.1.1 server 128.227.205.3
driftfile /var/db/ntp.drift
2. Setup a cron job to run the command each day
[root]# contab -e
This will open up your cron editor in vi. Add a line like this:
10 18 * * * /usr/sbin/ntptimeset -s
This will run ntptimeset at 6:10 pm every day. The -s parameter tells ntptimeset to go ahead and set the time
Only registered users can write comments. Please login or register. Powered by AkoComment 1.0 beta 2! |