Contact Us | Products/Services | Korn Shell | MicroEMACS


AIXtm mtXIA Technical Consulting Group

 


Time Synchronization


Path : Home : Standards


Current:Time Synchronization
Previous:AIX Web Environment
Home Page

The following are the AIX commands required to synchronize an AIX machine with a centralized time server. The time server uses the standard Network Time Protocol (NTP) to achieve synchronization. Also included in this documentation is the command to view the synchronization statistics.



#!/bin/ksh
################################################################
cp /etc/ntp.conf /tmp/ntp.conf.${$}
TMP_FILE="/tmp/tmp2${$}.out"

grep "^#" /etc/ntp.conf > "${TMP_FILE}"
print "server time.mtxia.com" >> "${TMP_FILE}"
print "driftfile /etc/ntp.drift" >> "${TMP_FILE}"
print "tracefile /etc/ntp.trace" >> "${TMP_FILE}"
print "peer time.mtxia.com" >> "${TMP_FILE}"

# DLF  egrep -v "^peer[$' \t']*fnet1" /etc/ntp.conf > "${TMP_FILE}"
# DLF  print "peer fnet1.mtxia.com" >> "${TMP_FILE}"

cp "${TMP_FILE}" /etc/ntp.conf
rm -f "${TMP_FILE}"

TMP_FILE="/tmp/tmp3${$}.out"
if sed -e "s|#[$' \t']*start[$' \t']*/usr/sbin/xntpd|start /usr/sbin/xntpd|" < /etc/rc.tcpip > "${TMP_FILE}"
then
    cp "${TMP_FILE}" /etc/rc.tcpip
fi

rm -f "${TMP_FILE}"

startsrc -s xntpd
lssrc -s xntpd


To check and see if the time daemon is sync'ed, run the command:


xntpdc
  xntpdc> sysinfo

Once the stratum is below 16, the time has synced to the peer.

 

For information regarding this page, contact Dana French ( dfrench@mtxia.com )
Copyright 2008 by Mt Xia Inc, All Rights Reserved