My MBP currently is not connected to the internet when it is booted. (vacation)
now I notice, that each time I return to OS X after a Bootcamped XP game, my system time is of by an hour. (XP and OS X seem to have a different opinion if the HWclock should run UTC or local time, and no, I don't intend to fight that)
How (bash or apple-script) can I tell my Mac to go fetch the correct time via ntp once it connects to the internet?
I know how to do it using the GUI (and I'd rather not .)
Stefan Lasiewski
2,25144 gold badges2323 silver badges3232 bronze badges
lexulexu
1,23266 gold badges2323 silver badges3737 bronze badges
2 Answers
I was experiencing the same problem ! I think, I have a better solution :
From my point of view it's better to tell WinXp to use the same time as Mac OS x (UTC) !
To do so, edit the following in the WinXP registry :
and set it to a KamiKami
DValue of 1.
2,52355 gold badges2424 silver badges2929 bronze badges
Kami is right, but if you only want to force a ntp update, use the following :
sudo ntpdate 0.ch.pool.ntp.org
You can, of course, change the time server !
StuderStuder
Not the answer you're looking for? Browse other questions tagged macosx-snow-leopardscriptboot-campntp or ask your own question.
When I have set Mac OS X to set it's date and time automatically, how often is this really done? And is there a way I can force an update?
SvishSvish
17.4k5555 gold badges111111 silver badges170170 bronze badges
5 Answers
NTPd (used by Mac OSX) will sync at the speed it thinks is more appropriate - that depends on your clock skew. It will be more frequent when you first turn it on / connect to the net and then will connect at longer intervals when it has stabilized your clock enough.
It does not only sync your current time and date, but also sync the actual clock speed. That means that after some time that you have enabled it (and are connected to the internet) your clock will be very precise even if you stay disconnected from the 'net for long times.
If you want the gory details, head on to wikipedia and to the NTP site.
Luke404Luke404
To manually update time with NTP, use
ntpdate from a shell:
e.g.,
References:
ntpdate options:
-v
Be verbose. This option will cause
ntpdate ’s version identification string to be logged.
-u
Direct
ntpdate to use an unprivileged port for outgoing packets. This is most useful when behind a firewall that blocks incoming traffic to privileged ports, and you want to synchronise with hosts beyond the firewall. Note that the -d option always uses unprivileged ports.
Ntp Server List
-q
Query only – don't set the clock.
Disclaimer: The functionality of this program is now available in the Scott
ntpd program.See the -q command line option in the ntpd - Network Time Protocol (NTP) daemon page.After a suitable period of mourning, the ntpdate program is to be retired from this distribution.
17k1111 gold badges4444 silver badges9191 bronze badges
IJCIJC
The network time daemon (ntpd) logs activity to /var/log/system.log. You can see recent activity with grep:
Read the ntp.conf man page ( Doug HarrisDoug Harris
man ntp.conf ) for details on further configuring ntpd including how much info is logged and (I assume) frequency of updates.
21.1k1414 gold badges6868 silver badges104104 bronze badges
Also if way out of date, turn off time server, set date manually first. Then when you turn on the NTP it will sync. Otherwise it just ignores what the time clock says. 1944 and 1970 years will not sync the clock.
RobertRobert
Checking/Unchecking the set timezone automatically on the date & time settings tab didn't help me.
I ended up using sntp client from the commandline
As you can see below, my time is ~30 seconds too fast.
❯ sntp pool.ntp.orgsntp [email protected] Tue Mar 21 14:36:42 UTC 2017 (136.200.1~2533)kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory2018-10-30 10:03:35.514209 (-0300) -27.660871 +/- 18.459649 pool.ntp.org 197.84.150.123 s2 no-leap
I slewed my clock as root
sh-3.2# sntp -S pool.ntp.orgsntp [email protected] Tue Mar 21 14:36:42 UTC 2017 (136.200.1~2533)kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory2018-10-30 10:06:26.214299 (-0300) -27.574985 +/- 18.423331 pool.ntp.org 41.231.53.4 s2 no-leap
A further sntp reveals that synchronization has been achieved
sh-3.2# sntp -S pool.ntp.orgsntp [email protected] Tue Mar 21 14:36:42 UTC 2017 (136.200.1~2533)kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory2018-10-30 10:06:02.523568 (-0300) -0.032662 +/- 0.061844 pool.ntp.org 41.231.53.4 s2 no-leap
LmwangiLmwangi
Not the answer you're looking for? Browse other questions tagged mactimentp or ask your own question.
now I notice, that each time I return to OS X after a Bootcamped XP game, my system time is of by an hour. (XP and OS X seem to have a different opinion if the HWclock should run UTC or local time, and no, I don't intend to fight that)
How (bash or apple-script) can I tell my Mac to go fetch the correct time via ntp once it connects to the internet?
I know how to do it using the GUI (and I'd rather not .)
Stefan Lasiewski
2,25144 gold badges2323 silver badges3232 bronze badges
lexulexu
1,23266 gold badges2323 silver badges3737 bronze badges
2 Answers
I was experiencing the same problem ! I think, I have a better solution :
From my point of view it's better to tell WinXp to use the same time as Mac OS x (UTC) !
To do so, edit the following in the WinXP registry :
and set it to a KamiKami
DValue of 1.
2,52355 gold badges2424 silver badges2929 bronze badges
Kami is right, but if you only want to force a ntp update, use the following :
sudo ntpdate 0.ch.pool.ntp.org
You can, of course, change the time server !
StuderStuder
Not the answer you're looking for? Browse other questions tagged macosx-snow-leopardscriptboot-campntp or ask your own question.
When I have set Mac OS X to set it's date and time automatically, how often is this really done? And is there a way I can force an update?
SvishSvish
17.4k5555 gold badges111111 silver badges170170 bronze badges
5 Answers
NTPd (used by Mac OSX) will sync at the speed it thinks is more appropriate - that depends on your clock skew. It will be more frequent when you first turn it on / connect to the net and then will connect at longer intervals when it has stabilized your clock enough.
Time Server Ntp Ip
It does not only sync your current time and date, but also sync the actual clock speed. That means that after some time that you have enabled it (and are connected to the internet) your clock will be very precise even if you stay disconnected from the 'net for long times.
If you want the gory details, head on to wikipedia and to the NTP site.
Luke404Luke404
To manually update time with NTP, use
ntpdate from a shell:
e.g.,
References:
ntpdate options:
-v
Be verbose. This option will cause
ntpdate ’s version identification string to be logged.
-u
Direct
ntpdate to use an unprivileged port for outgoing packets. This is most useful when behind a firewall that blocks incoming traffic to privileged ports, and you want to synchronise with hosts beyond the firewall. Note that the -d option always uses unprivileged ports.
-q
Query only – don't set the clock.
Disclaimer: The functionality of this program is now available in the Scott
ntpd program.See the -q command line option in the ntpd - Network Time Protocol (NTP) daemon page.After a suitable period of mourning, the ntpdate program is to be retired from this distribution.
17k1111 gold badges4444 silver badges9191 bronze badges
IJCIJC
The network time daemon (ntpd) logs activity to /var/log/system.log. You can see recent activity with grep:
Read the ntp.conf man page ( Doug HarrisDoug Harris
man ntp.conf ) for details on further configuring ntpd including how much info is logged and (I assume) frequency of updates.
21.1k1414 gold badges6868 silver badges104104 bronze badges
Also if way out of date, turn off time server, set date manually first. Then when you turn on the NTP it will sync. Otherwise it just ignores what the time clock says. 1944 and 1970 years will not sync the clock.
RobertRobert
Checking/Unchecking the set timezone automatically on the date & time settings tab didn't help me.
I ended up using sntp client from the commandline
As you can see below, my time is ~30 seconds too fast.
❯ sntp pool.ntp.orgsntp [email protected] Tue Mar 21 14:36:42 UTC 2017 (136.200.1~2533)kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory2018-10-30 10:03:35.514209 (-0300) -27.660871 +/- 18.459649 pool.ntp.org 197.84.150.123 s2 no-leap
I slewed my clock as root
sh-3.2# sntp -S pool.ntp.orgsntp [email protected] Tue Mar 21 14:36:42 UTC 2017 (136.200.1~2533)kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory2018-10-30 10:06:26.214299 (-0300) -27.574985 +/- 18.423331 pool.ntp.org 41.231.53.4 s2 no-leap
A further sntp reveals that synchronization has been achieved
sh-3.2# sntp -S pool.ntp.orgsntp [email protected] Tue Mar 21 14:36:42 UTC 2017 (136.200.1~2533)kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory2018-10-30 10:06:02.523568 (-0300) -0.032662 +/- 0.061844 pool.ntp.org 41.231.53.4 s2 no-leap
LmwangiLmwangi
Not the answer you're looking for? Browse other questions tagged mactimentp or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |