Need a script to synchronize with public time servers
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.