LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need a script to synchronize with public time servers (https://www.linuxquestions.org/questions/linux-newbie-8/need-a-script-to-synchronize-with-public-time-servers-602944/)

basis1980 11-28-2007 04:22 AM

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..

houkouonchi 11-28-2007 05:01 AM

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?

jphilput 11-28-2007 08:03 AM

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.

Boow 11-28-2007 09:34 AM

just use cron and ntpdate you'll have to google your own timeserver.


All times are GMT -5. The time now is 07:02 AM.