LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 11-28-2007, 05:22 AM   #1
basis1980
LQ Newbie
 
Registered: Nov 2007
Posts: 15

Rep: Reputation: 0
Need a script to synchronize with public time servers


I have been googling about this for days but could not find anything. I have to synhcronize my system time with one of the public time servers. I know there are packages like ntp, rdate, chrony and such designed for that. But the thing is I do not want to install any packages to do that and I am sure that this can be done by a bash script that would connect to those servers (on port 123?) and get time info and set the time by date and any other command using the info from the time server. Anybody have a clue on this?

I use debian by the way..
 
Old 11-28-2007, 06:01 AM   #2
houkouonchi
LQ Newbie
 
Registered: Nov 2005
Location: Corona, CA
Posts: 12

Rep: Reputation: 0
Since its UDP i doubt it is going to be easy to do via a script. Maybe netcat? I can't imagine what would be the big deal of installing ntpdate?
 
Old 11-28-2007, 09:03 AM   #3
jphilput
Member
 
Registered: Nov 2007
Posts: 58

Rep: Reputation: 15
Creating a script to keep your time in sync is not a trivial task. You would effectively be creating a new NTP client from scratch. Your best bet would be to configure NTP on the system since keeping the system time in sync is what it was designed to do. You don't have to allow other people to connect to you as a time source.
 
Old 11-28-2007, 10:34 AM   #4
Boow
Member
 
Registered: Feb 2004
Distribution: Slackware 10.2
Posts: 669

Rep: Reputation: 32
just use cron and ntpdate you'll have to google your own timeserver.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 synchronize time between two machine??? ajeetraina Linux - Desktop 1 11-27-2007 06:34 AM
rsync to synchronize by time or size pericop Linux - Server 0 02-11-2007 11:26 AM
I Can't Access Public Time Servers Legolas327 Linux - Newbie 3 10-16-2006 09:36 PM
Synchronize time kenneho Debian 11 01-21-2006 06:08 AM
synchronize time between linux and XP server taiwf Linux - General 1 11-03-2005 10:52 PM


All times are GMT -5. The time now is 03:16 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration