Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am performing some experiments on a network of about 10 remote Linux computers which are geographically scattered.

I suspect some of them have clock skews but they are seen transiently (eg. once in a week or twice in a month).

I was wondering if there exists some tools which could detect and quantify such clock skews. Also wondering if clock skew is the right term for what I am witnessing or could it be called clock synchronization.

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

Are you trying to keep the clocks synchronized to the right time, or are you trying to determine how accurate the real time clock actually is, without being synchronized?

If you simply want the times to be correct, there's a whole hierarchy of time servers that systems can sync to, and it's often built in to the OS, although you can usually specify time servers. Also, one system can synch to a time server, and then run its own time server for the other systems to sync to.

I have seen, and even used in the past, programs that not only sync to a standard time, but keep up with the local computer's drift from the last synchronization. I used this in the past when we had intermittent internet connections, so the program would correct the time by using the history of expected drift.

Usually, with either of these methods, if the correction is too much, it may assume an error and not do any correction at all.

Hopefully, I'm not totally missing your point. :)

share|improve this answer
    
Thanks. I came across htp: clevervest.com/htp which seems to help synchronize times between machines. However, I am also interested in finding out exactly how many seconds/milliseconds are the various machine's off from a standard reference clock. I would think some standard linux utility would do this and am trying to find one. –  Ketan Jul 2 '12 at 2:13
2  
NTP is the standard for time sync. There were utilities that calculated the drift years ago; I remember source code for Unix at the time, but I don't remember right now what the names were. Search for time synchronization and correction. –  Marty Fried Jul 2 '12 at 2:16
add comment

Use the NTP-daemon for this.

Define a number of - independent - ntp-servers to contact (ntp.conf, server-directive). 3 servers are good, more are better.

The network-time-protocol will sort out "bad" time sources. Look at the output from ntpq -p after you ran the ntpd for a couple of hours.

You will see which primary server has been chosen, which ones are considered "good" and which ones are considered "bad". The output also contains jitter and latency (offset). These are propably the values you are after...

share|improve this answer
add comment

The crony utility has a drift file. See: http://chrony.tuxfamily.org/manual.html#Configuration-options-overview
I do not know the format of that file as I have not yet installed it myself. It does have a command to view the drift info: chronyc sourcestats -v
I plan to install crony on my virtual machines as a start.

This site looks helpful: http://www.markus-gattol.name/ws/time.html

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.