LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-06-2009, 04:47 PM   #1
JohnRock
Member
 
Registered: May 2009
Posts: 36

Rep: Reputation: 15
Easiest way to sync system time between two servers?


I have server A running a daily cron to sync its time using ntpd:
e.g.

ntpd -qg (it simply sets its time and then exits)

I would like to sync server B's system time to server A.

Specifically:
1. Server B is not connected to internet so it cannot sync with the same time servers as server A is doing
2. I would like to avoid perpetually running the ntpd service on server A as I feel this is overkill - I just want to update once a day and that's it.

So is it possible to write a simple script that updates server B's time to that of server A without having to run server B as a ntp client of server A and keep server A running as an ntpd server?

Thanks for helping me figure out if this is possible. Or, if anyone can think of a better idea to accomplish what I am looking for I would love to hear it.

Thanks
 
Old 06-06-2009, 07:03 PM   #2
javaroast
Member
 
Registered: Apr 2005
Posts: 131

Rep: Reputation: 19
I guess you could run some sort of script that grabbed the time on Server A and then did some string manipulations to set the time on Server B. But the easiest, simplest method is running ntpd. I haven't seen many overhead issues with ntp servers.
 
Old 06-06-2009, 07:15 PM   #3
JohnRock
Member
 
Registered: May 2009
Posts: 36

Original Poster
Rep: Reputation: 15
I was concerned about running an extra process for one, but also whether it is a security risk to run ntpd on a production webserver? Do I have to leave port 123 open to do that?
 
Old 06-06-2009, 07:26 PM   #4
javaroast
Member
 
Registered: Apr 2005
Posts: 131

Rep: Reputation: 19
Ok I'm assuming that the servers connect over the local network as Server B can not connect to the internet. If that is the case you would only have to have open 123 on the local network. You can tighten that down even further using iptables.

You can also use the ntp.conf to set restrictions on what systems Server A can connect to here's a link to walk you through it. Personally though I just use IPTables.

http://support.ntp.org/bin/view/Supp...ection_6.5.1.2.
 
  


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
how to sync or monitor time for lots of remote servers? montyleesam Linux - Server 1 10-27-2008 03:59 AM
What is the easiest way to run a shell script in the background on 10 servers? abefroman Linux - Software 3 03-12-2008 09:24 AM
Dropline sync with time servers not working BCarey Slackware 4 12-05-2006 10:17 AM
Sync KDE/System Time w/ NTP carlosinfl Linux - General 6 03-15-2006 03:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:25 PM.

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