LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-19-2014, 12:42 AM   #1
vjlxmi
Member
 
Registered: Aug 2014
Posts: 38

Rep: Reputation: Disabled
set exact time according to the second system


Hello,
I have two systems. So, is there any way by which I can set the exact time in the second system as the one on the first system?
Thanks in advance
 
Old 09-19-2014, 01:11 AM   #2
es0teric
Member
 
Registered: Apr 2007
Distribution: Ubuntu
Posts: 105

Rep: Reputation: 19
NTP is the standard protocol for keeping time synchronized across distributed systems
http://en.wikipedia.org/wiki/Network_Time_Protocol
 
Old 09-22-2014, 01:56 AM   #3
vjlxmi
Member
 
Registered: Aug 2014
Posts: 38

Original Poster
Rep: Reputation: Disabled
NTP sets the time using the internet. Is there any option where two systems have the same time when there is no internet connection on either of them?
 
Old 09-22-2014, 03:35 AM   #4
kaushalpatel1982
Member
 
Registered: Aug 2007
Location: INDIA
Distribution: CentOS, RHEL, Fedora, Debian, Ubuntu, LinuxMint, Kali Linux, Raspbian
Posts: 166

Rep: Reputation: 10
In case you have one linux system then you can configure it is NTP server. Now send a request from another system to the server to sync time.
 
Old 09-22-2014, 09:05 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,617

Rep: Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963
Quote:
Originally Posted by kaushalpatel1982 View Post
In case you have one linux system then you can configure it is NTP server. Now send a request from another system to the server to sync time.
...which won't work, since the first system won't be an authoritative time source, and therefore be untrusted as one, so the NTP request will fail. Unless you have SOME accurate time reference, the best you can hope for is to get close. The servers won't sync.
 
Old 09-22-2014, 09:14 AM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
It can be authoritative for the local network.

The main problem is that a system without a good clock (none have a decent clock) will drift. The difference between a good clock and a bad is the drift. A good clock will still drift... but in a consistent direction. Bad clocks (the usual kind) drift up... then drift down. Sometimes dependent on temperature, other times on power fluctuations (sometimes both).

If the two systems need to be very close then change the NTP query time... shorter times will keep the two systems much closer togethter.
 
Old 09-22-2014, 09:19 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Raises some interesting thoughts - who verifies {non-}authoritative time-stamps on transmissions containing legal documents ....
 
Old 09-22-2014, 09:22 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,617

Rep: Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963
Quote:
Originally Posted by jpollard View Post
It can be authoritative for the local network.

The main problem is that a system without a good clock (none have a decent clock) will drift. The difference between a good clock and a bad is the drift. A good clock will still drift... but in a consistent direction. Bad clocks (the usual kind) drift up... then drift down. Sometimes dependent on temperature, other times on power fluctuations (sometimes both).

If the two systems need to be very close then change the NTP query time... shorter times will keep the two systems much closer togethter.
I have NEVER been able to get NTP to keep step without an accurate clock somewhere. Systems have ALWAYS drifted too much to be trusted. And given that NTP is a stateless UDP protocol, allowing port 123 through a firewall to connect to a well-known time source on the net doesn't present much of a risk. Even doing it for ONE tiny VM machine that does nothing BUT act as an internal clock buys you a lot.

To me, it's pointless to NOT have an accurate internal time server. Between the large internet time pools and being able to use a $30 GPS receiver into a USB port (which gets you a stratum 1 clock, with NO firewall ports opened at all), there's no reason not to.
 
Old 09-22-2014, 09:32 AM   #9
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by TB0ne View Post
I have NEVER been able to get NTP to keep step without an accurate clock somewhere.
It all depends on the definition of "accurate clock". If the system is defined to be "accurate" for the network (which may not be connected to the internet), then just shortening the client interval for updates will keep it "close enough".
Quote:
Systems have ALWAYS drifted too much to be trusted. And given that NTP is a stateless UDP protocol, allowing port 123 through a firewall to connect to a well-known time source on the net doesn't present much of a risk. Even doing it for ONE tiny VM machine that does nothing BUT act as an internal clock buys you a lot.

To me, it's pointless to NOT have an accurate internal time server. Between the large internet time pools and being able to use a $30 GPS receiver into a USB port (which gets you a stratum 1 clock, with NO firewall ports opened at all), there's no reason not to.
It all depends on what is being checked against. A stand alone local network is fine using a system for reference - accuracy will not be within a microsecond... but then nothing is. It is usually sufficient to be within 1 second, and within 16 milliseconds is rather easy to obtain. All it means is that the clocks on the given network are in sync.

They don't HAVE to be in sync with the rest of the world.
 
Old 09-23-2014, 06:30 AM   #10
kaushalpatel1982
Member
 
Registered: Aug 2007
Location: INDIA
Distribution: CentOS, RHEL, Fedora, Debian, Ubuntu, LinuxMint, Kali Linux, Raspbian
Posts: 166

Rep: Reputation: 10
TB0ne,

I am using this scenario to sync date of my network appliances like PCs and Servers. As This is local network, I don't care it is accurate or not but but when I check logs I must have same time on server and client. This will help me to troubleshoot issues.

second case, if none of the PCs or server have internet access or I dont want that all PC go on internet for NTP and still I want to sync accurate time. In this case I should have Local NTP server which sync time from internet server and All other network devices sync their time with local NTP server. That will help to control Internet Traffic.
 
Old 09-23-2014, 06:36 AM   #11
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by kaushalpatel1982 View Post
TB0ne,

I am using this scenario to sync date of my network appliances like PCs and Servers. As This is local network, I don't care it is accurate or not but but when I check logs I must have same time on server and client. This will help me to troubleshoot issues.

second case, if none of the PCs or server have internet access or I dont want that all PC go on internet for NTP and still I want to sync accurate time. In this case I should have Local NTP server which sync time from internet server and All other network devices sync their time with local NTP server. That will help to control Internet Traffic.
No need for access to the internet. It is usually cheaper to use a GPS receiver with a built-in NTP server. The GPS signals already include a very high clock resolution. The NTP server side just provides that time. They usually can also provide the location, but most places disable this feature.

Simpler on your security too as no network connection is required.

Last edited by jpollard; 09-23-2014 at 06:39 AM.
 
Old 09-23-2014, 09:15 AM   #12
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,617

Rep: Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963
Quote:
Originally Posted by kaushalpatel1982
I am using this scenario to sync date of my network appliances like PCs and Servers. As This is local network, I don't care it is accurate or not but but when I check logs I must have same time on server and client. This will help me to troubleshoot issues. second case, if none of the PCs or server have internet access or I dont want that all PC go on internet for NTP and still I want to sync accurate time. In this case I should have Local NTP server which sync time from internet server and All other network devices sync their time with local NTP server. That will help to control Internet Traffic.
As said before, you DO NOT have to put ANY of your devices on the Internet. You set up ONE system on your internal network that DOES have NTP, and have all your devices point to IT. NOTHING leaves your internal network, if you use a GPS receiver. If you're concerned about security (which you must NOT be, since you don't want accurate time...since if you don't have that, you can't accurately collate events between your internal network and external events), you have many options. You bring up one little box...an old desktop PC is MORE than you need, and have it be your NTP server. Either have it reference the Internet clock pools (easy, accurate, and secure), or use a GPS. Then tell everything on your internal network to point to IT for the time. Done.
Quote:
Originally Posted by jpollard View Post
No need for access to the internet. It is usually cheaper to use a GPS receiver with a built-in NTP server. The GPS signals already include a very high clock resolution. The NTP server side just provides that time. They usually can also provide the location, but most places disable this feature.

Simpler on your security too as no network connection is required.
Exactly. I usually go the GPS route, but you don't NEED the receiver to have a built-in NTP server. Just a cheap USB GPS receiver can easily be set up to be queried by NTP, using the NMEA data, and provides a stratum 1 clock...with 0 being atomic-clock. That's why I think (given the many options), it's a bad thing to NOT have a decent time reference.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set and sync system time with time server?? servnov Linux - Newbie 6 12-03-2013 07:55 PM
[SOLVED] Set system language to spanish and set time of the system correctly. nando321 Arch 2 10-24-2012 10:30 AM
Not able to set system time using script. muthu@sanatdata.net Linux - Server 2 04-25-2008 03:46 PM
Where does RH8 daily set system time to hardware clock time smartnorman Red Hat 1 05-24-2006 02:42 PM
set system time xushi Slackware 3 03-31-2005 08:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration