Setup NTP date sync

Make sure you set up ntp to work and then just run it every time. Use dsh date to check that you are working. Below is a configuration file to be put into /etc/rc.d/rc2.d as Sntpd and Kntpd:

#!/bin/ksh

##################################################
# name: Xntpd
# purpose: script that will start or stop the time daemon. Configure it in /etc/ntpd.conf
##################################################

case "$1" in
start )
        startsrc -s xntpd
        ;;
stop )
        stopsrc -s xntpd
        ;;
* )
        echo "Usage: $0 (start | stop)"
        exit 1
esac

/etc/ntp.conf

# @(#)48        1.2  src/tcpip/etc/ntp.conf, ntp, tcpip510 2/16/96 10:16:34
#
#   COMPONENT_NAME: ntp
#
#   FUNCTIONS: none
#
#   ORIGINS: 27,176
#
#
#   (C) COPYRIGHT International Business Machines Corp. 1996
#   All Rights Reserved
#   Licensed Materials - Property of IBM
#   US Government Users Restricted Rights - Use, duplication or
#   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
#
#
#
# Default NTP configuration file.
#
#   Broadcast client, no authentication.
#
#broadcastclient
driftfile /etc/ntp.drift
tracefile /etc/ntp.trace

server mydomaincontroller01
server mydomaincontroller02

peer mypeer01
peer mypeer02

To sync to the ntp server immediately and only if xntpd isn’t running:

ntpdate mydomaincontroller01

Leave a Reply

Your email address will not be published. Required fields are marked *