Date & Time are not automatically being updated
Many of the old iMac computers in the school labs do not reliably maintain the correct time. The computers seem to “eat” clock batteries. I will replace a clock battery at the start of the month, and the battery is dead by the end if the month.
A Windows 2000 server provides login authentication. We quickly found that Active Directory denies login if the iMac computer time is more than about 2 minutes different from the Windows server. To keep the iMac time correct, even with a bad clock battery, we enable the “Set Date & Time automatically” option in the Date & Time Preference panel. The computers are running 10.3.9 and 10.4.2 and later
Two Issues:
1). A student is unable to login at one of the iMac computers. I login as the local administrator and notice that the time in the menu bar is wrong. As soon as I open the Date & Time Preference panel, the correct time will appear on the screen.
2). I have also tested the “Set Date & Time automatically” option on a Macintosh computer that is connected to the network before our network firewall. This computer will stray 15 seconds from the correct time each week, but as soon as I open the Date & Time Preference panel, the correct time will appear on the screen. This computer is on 24/7, yet it does not automatically update its time.
Question:
How can I get the time to update automatically without manually opening the Date & Time Preferences? The best solution would be a command that could be run at startup and daily to sync the computer’s clock with a time server on the Internet.
Two Things I Have Tried:
1). I have two automated tasks that run every morning. They are sent out using Apple Remote Desktop ver 3.1. The first command disable the use of a network time server. The second command then re-enables the use of a network time server. The disable command simply unchecks the “Set Date & Time automatically” setting. The enable command replaces the checkmark in the “Set Date & Time automatically” option and then forces the computer to get the CORRECT time. This does “sorta work”, but the computers must all be on before Apple Remote Desktop sends out the commands. If a computers is still off, it will not get the commands.
2). I found a computer with the wrong time. I logged in as a local admin. I opened a Terminal window and typed the following command:
sudo /usr/sbin/ntpdate time.apple.com When prompted, I entered the admin password.
The time shown in the menu bar was not corrected and the following was displayed in the command window
2 Apr 12:10:40 ntpdate[5119]: the NTP socket is in use, exiting
Not until I manually opened the Date & Time Preference panel, did the time snap to the correct time. So this method was not helpful.
A once found instructions online that used CRON for updating the time every hour, but I have not been able to locate it again. I am not sure it would even work, but I will keep looking.
600 MHz G3 iMac and Later Mac OS X (10.4)