Skip to main content

Good afternoon



Would anybody happen to know which mcx preference controls the "Set date
and time automatically" tick box below?



Cheers



Joe



+ 60 Kingly Street, London, W1B 5DS
* helpdesk at bbh.co.uk
( +44 207 453 4983
4



www.bartleboglehegarty.com



This transmission is from BBH Partners LLP, it is confidential and intended
solely for the person or organisation to whom it is addressed. This
transmission may contain confidential information within its content or any
attachment. You should not copy, use or distribute in any way any of the
information contained within this transmission other than in accordance
with the prior written permission of an authorised BBH representative.



Partnership Information:
Registered name: BBH Partners LLP
Registered office: 60 Kingly Street London W1B 5DS
Place of registration: England and Wales
Registered number: OC355051



Although all messages/file attachments passing through this gateway are
scanned for viruses we cannot guarantee that any file is 100% virus-free.
/



![external image link](attachments/250df281828b43c9af8e15d2907f92c2)
![external image link](attachments/c545bedb0d794aa2a55c1cfbb4f35bcc)

look at systemsetup man pages.



Sean



![external image link](attachments/e53eea7f9f3e4012bd212593fb7d61ba)
![external image link](attachments/16636bc643a946368ea596e04b3dc1cb)


Hi Joe



I'll save you reading the man page.



I think the pref is in /Library/Preferences/com.apple.MCX with the keyname "TimeServer"



We actually set this option through a script though.



The option to turn it on is, "systemsetup -setusingnetworktime on"



This is a script we use to



* Check the option is turned on



* Set the correct time server if it is wrong



* Force a time sync by turning the preference on and off.



TIMESERVER=systemsetup -getnetworktimeserver | awk '{print $4}'



CHECK=systemsetup -getusingnetworktime | awk '{print $3}'



if [[ "$CHECK" = "Off" ]]; then
echo "Time sync is switched off. Turning on"
systemsetup -setusingnetworktime On
elif [[ "$CHECK" = "On" ]]; then
echo "Time sync is on."
else
echo "Cant determine prefrence status. Exiting"
exit 1
fi



if [[ "$TIMESERVER" = "time.asia.apple.com" ]]; then
echo "Time server is correct. Syncing time"
systemsetup -setusingnetworktime off
sleep 5
systemsetup -setusingnetworktime on
exit 0
else
echo "Server is incorrect. Setting time server to Apple Asia."
systemsetup -setnetworktimeserver time.asia.apple.com
echo "Syncing time"
systemsetup -setusingnetworktime off
sleep 5
systemsetup -setusingnetworktime on
exit 0
fi


Nice script.



One item I like to add is a secondary time server. If available, set one internal and one external. Rather then using systemsetup -setnetworktimeserver you might try:



echo "server internal.time.server" > /private/etc/ntp.conf
echo "server external.time.server" >> /private/etc/ntp.conf



Leslie N. Helou
Senior Systems Engineer
Bell Techlogix
8888 Keystone Crossing, Suite 1700
Indianapolis, IN 46240
317.704.6408


Reply