Sync locally without an NTS

Hi,

I’ve written a script that uses NTP (Network Time Protocol) in order to verify and change a local machines time and date. Unfortunately though my lab computers work with limited throughput of bandwidth (a canopy system) and obtaining data from Apple’s network time server can take an excruciating amount of time (which timeouts 30% to 50% of the time). Instead of using the terminal command “ntpdate” to acquire such info, is it possible to sync a client locally to a file share server instead? I’m not finding any UNIX commands (or switches for ntpdate) that override this.

Er, this does not really have much to do with AppleScript, does it?

The automatic time synchronization is done by the background process ntpd. Its configuration file is /etc/ntp.conf. Normally the contents of this file is determined by the settings made in the Date & Time preference pane in System Preferences. If Set date & time automatically is checked, then the ntpd process will be started and configured (through /etc/ntp.conf) to synchronize the date and time from the specified server. There are some Apple NTP servers listed (time.apple.com, time.asia.apple.com, time.euro.apple.com), but you can type in the IP address (or a hostname, if you have a reliable way to resolve the hostname) of any server you like. So if you have a local server that has sufficient Internet connectivity and can synchronize to Apple’s time servers (or some other time server, ask your network folks), you can point your lab machines at this local server.

In short, ask your network admin if there is a local NTP sever to which to can point your machines. Otherwise select a machine that has sufficient Internet and local connectivity and make it a local NTP server. Then configure your local lab machines to sync to that local server instead of the default Apple server (just type in the IP address in the place of Apple’s server’s name).

If you really want to use use ntpdate instead of letting ntpd do its job in the background, you can specify the NTP server on the ntpdate command line. Just make it the last parameter (it seems to use the server(s) specified in /etc/ntp.conf if no server is supplied on the command line). Check out the ntpdate manpage.

Thanks Chrys,

It does but it doesn’t have to do with Apple scripting. It’s part of my script when running the ntpdate command. Since there’s no particular forum within the BBS on UNIX integration or miscellaneous AS I figured it might be best to post it here (since there’s a lot of experienced and helpful people who frequent this site).

Anyways I’ll go ahead and modify the ntp.conf file on the clients so it points to the local server (which is locked to NTS apple.time.com).

Thanks again for the help.