You are not logged in.
hi to everybody,
i have confusion about time updater:
i have set the time, timezone and related in rc.conf and the time is right
however after 1 month,more or less, my time is wrong.... so i need and automated time updater
i read in our archwiki and i've found NTP
reading NTP, i'm confusing about HWCLOCK daemon and NTP daemon
someone can explain me what i need for updating correctly my time (UTC - hardware clock) ?
thanks
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline
hwclock is for when you don't use NTP. If in doubt, disable hwclock, install and run ntpd instead.
Offline
I thought hwclock was for synchronising hardware clock with OS clock, and NTP was synchronising OS clock with internet.
Offline
I thought hwclock was for synchronising hardware clock with OS clock, and NTP was synchronising OS clock with internet.
Both tools are used for the same general purpose: to keep your time accurate. With hwclock you can set your OS time to your hardware time and vice versa.
Offline
In my mind, hwclock is critical because it is available at boot to initialize the system clock. NTP then (when available) servos the system time to internet time and fine tunes the system so that time remains accurate when NTP goes away. Finally, at shutdown, the accurate system time is put back to the hardware clock so that it is as accurate as possible at the next startup.
They really need to work together
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
From wiki: ntpd sets 11 minute mode, which syncs the system clock to hardware every 11 minutes. The hwclock daemon measures hardware clock drift and syncs it, which conflicts with ntpd.
So ntp will sync time with hardware clock periodically without hwclock running as daemon.
Offline
One solution for a desktop user is to add this to rc.local:
ntpd -qg &
hwclock --systohc
ntpd sets the time and quits then the hwclock command adjusts the time. No daemons running from rc.conf. Of course, for a 24/7 server this is not the best, but for a desktop it's good enuogh.
Last edited by swanson (2011-08-12 06:30:59)
Offline
For 24/7 desktop: ntpdate in cron.hourly.
I'll probably get slated, but works a treat for me.
Offline
because my hardware clock isn't enough precise, i need a tool that retrieve time from another but precise source and after a tool that write the time into hardware clock
by what i've read hwclock ONLY save time from/to system/hardware clock AND isn't able to retrieve correct time
instead this feature is present in NTP
is right ? have i well understand ?
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline
Offline
so, as swanson says, i can use this combination of command:
ntpd -qg &
hwclock --systohc
first for retrieving correct time
second for saving it into my hardware clock
for my use i can put their into the cron.hourly directory
is right ?
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline
only putting ntpd in your DAEMONS array works fine for me. the daemon connects to the internet and gets the correct time. Why do you need to create a cron job?
if you are using hwclock to simply correct for the incorrect time in hardware clock, have a look at Time skew in the wiki. Maybe all you need to do is delete hwclock's adjtime file. It will be recreated and you probably won't have issues with the hardware clock going haywire.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
It's right there in the wiki
ntpd sets 11 minute mode, which syncs the system clock to hardware every 11 minutes. The hwclock daemon measures hardware clock drift and syncs it, which conflicts with ntpd.
Offline
only putting ntpd in your DAEMONS array works fine for me. the daemon connects to the internet and gets the correct time. Why do you need to create a cron job?
if you are using hwclock to simply correct for the incorrect time in hardware clock, have a look at Time skew in the wiki. Maybe all you need to do is delete hwclock's adjtime file. It will be recreated and you probably won't have issues with the hardware clock going haywire.
because putting in daemon's array, every time i boot, ntp synchronize the time
instead if i put command in cron, it will be executed, so ntp synchronize, only once at month for example , not every time i boot....
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline
Inxsible wrote:only putting ntpd in your DAEMONS array works fine for me. the daemon connects to the internet and gets the correct time. Why do you need to create a cron job?
if you are using hwclock to simply correct for the incorrect time in hardware clock, have a look at Time skew in the wiki. Maybe all you need to do is delete hwclock's adjtime file. It will be recreated and you probably won't have issues with the hardware clock going haywire.
because putting in daemon's array, every time i boot, ntp synchronize the time
instead if i put command in cron, it will be executed, so ntp synchronize, only once at month for example , not every time i boot....
I'm with Inxsible here, check your adjtime file.
Offline
Inxsible wrote:only putting ntpd in your DAEMONS array works fine for me. the daemon connects to the internet and gets the correct time. Why do you need to create a cron job?
if you are using hwclock to simply correct for the incorrect time in hardware clock, have a look at Time skew in the wiki. Maybe all you need to do is delete hwclock's adjtime file. It will be recreated and you probably won't have issues with the hardware clock going haywire.
because putting in daemon's array, every time i boot, ntp synchronize the time
instead if i put command in cron, it will be executed, so ntp synchronize, only once at month for example , not every time i boot....
And the problem with it synchronizing on every boot is ........?
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
yes, only because i need to update time not every time i boot.....
and adjtime is executed every hour, right, but if hwclock daemon isn't running it doesn't do anything
so, excluding my idea to add a cron, i need only to put "ntpd" in my daemon array ? then, adjtime cron take care of saving software clock (because ntp set only the software clock) in the hardware clock ?
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline
Please post the output of
cat /var/lib/hwclock/adjtime
Offline
only putting ntpd in your DAEMONS array works fine for me. the daemon connects to the internet and gets the correct time. Why do you need to create a cron job?
I never got it to work with Arch package. It seemed the daemon worked as a server rather then a client. I ended up installing vanilla NTP and adding a 1-liner into cron.hourly... Simples.
Offline
One solution for a desktop user is to add this to rc.local:
ntpd -qg & hwclock --systohc
ntpd sets the time and quits then the hwclock command adjusts the time. No daemons running from rc.conf. Of course, for a 24/7 server this is not the best, but for a desktop it's good enuogh.
This FINALLY fixed mine. Is there any way to make this fix the system clock faster?
Offline
Please post the output of
cat /var/lib/hwclock/adjtime
6.948322 1313062939 0.000000
1313062939
UTC
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline
karol wrote:Please post the output of
cat /var/lib/hwclock/adjtime
6.948322 1313062939 0.000000 1313062939 UTC
Looks fine. If the first number in the first line gets too high, your clock will show the wrong time. You can check the file e.g. in a month.
Offline
now my question is:
how many times ntpd retrieve the correct time from servers ?
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline