I have researched many different of ways to accurately keep time in Linux, but there are so many programs and ways of doing it. I would like to know what you guys think is the best way to keep the system clock and the RTC on the accurate time 24/7. Note: I turn my Linux machine off for extended periods of time
- I am not aware of any method other than NTP. Can you give an example of the "many different ways" you found in your researches?michas– michas2015-03-13 00:38:12 +00:00Commented Mar 13, 2015 at 0:38
- There's also RTC (Realtime Clock), GPS and HF/LF time pulses that are transmitted around the world.captcha– captcha2015-03-13 01:01:43 +00:00Commented Mar 13, 2015 at 1:01
2 Answers
To me, NTP is the obvious answer. Reliable and consistent - assuming some sort of Internet connection, with an option that's enabled on many distributions to set the clock directly during the boot-up process.
However, this is an opinion-based answer, probably not suited to SE.
As the ultimate in non-fancy approaches, every-time i login (approximately once a day) my .bashrc runs this:
sudo rdate time-b.timefreq.bldrdoc.gov && hwclock -w I did a little testing a year or so ago and it apparently kept my main computer within one second of official time. and yes, it should just be made into a line of a cron job, but there are untapped vistas of laziness yet to be plumbed.