SlackwareThis Forum is for the discussion of Slackware Linux.
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is it possible that i point local time to an internet address. I want to update my local time from internet, as my CMOS battery is not in best of shape... :-P
will sync your system time to the server you specify. Do a google search for
"public ntp servers" and you'll most likely find one in you area of the world,
or check to see if your isp has their own.
If you want to get serious you could always configure ntpd to constantly adjust the time, but for most folk that's overkill and a ntpdate on bootup or once a day is probably more than enough.
edit:
forgot to say: you'll need to run it as root for obvious reasons.
ntpdate will only update the system time though, if you want to update the internal hardware clock from the system time after a ntpdate:
hwclock --systohc
Saving system time to the hardware clock is included in the system shutdown scripts so it isn't strictly necessary to do this, though it won't hurt any.
This is a good idea, and I probably should consider this since my battery is also screwed. After 9 years of use, what did I expect? Of course having ntpd on boot for me is not much of an option, because I don't ever shutdown, or ever reboot, unless there is a power outage. So I might need to have ntpd run at certain intervals since my system time goes out of sync in a day or so. I guess battery problems cause different problems for users. In my case, the time on my machine actually ends up being AHEAD of my actual local time.. (CST)
So now, according to my mobile phone, it is 3:06 p.m., but my system time says 3:14.... If I am to keep it like this, sooner or later it would end up being an hour ahead of what my actually time is.
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370
Rep:
You can set up a simple crontab entry that will update the clock at fixed intervals, every 15 minutes, every hour, once every 24 hours or at whatever interval you choose.
I saw this tutorial, but it seems to be a bit old. I mean, in stock 12.1 there are both /etc/ntp.conf and /etc/rc.d/rc.ntpd. The npd daemon is running by default in 12.1 and I think this is why when I issue as root:
Code:
root@marto:~# ntpdate ntp.host.bg
I get:
Code:
18 Sep 14:16:21 ntpdate[17019]: the NTP socket is in use, exiting
Probably we should somehow just modify the ntp.conf file to adjust it to a relevant local time server rather than to localhost 127.0.0.1?
I would be thankful if you post your suggestions for the modifications needed.
You should disable /etc/rc.d/rc.ntpd (chmod -x /etc/rc.d/rc.ntpd)
so it won't start at boot, you want to use ntp as client, you don't want to set a time server, right ?
You should disable /etc/rc.d/rc.ntpd (chmod -x /etc/rc.d/rc.ntpd)
so it won't start at boot, you want to use ntp as client, you don't want to set a time server, right ?
So it is. I already killed the running ntpd and used ntpdate successfully. What you say is an option, of course. But isn't there some easy modification of the default scripts to set them to a local time server?
I don't know, I wonder what is the use of a local time server...
I just use ntpdate for my part (I set an entry in root crontab to update it once a day)
I don't know, I wonder what is the use of a local time server...
I just use ntpdate for my part (I set an entry in root crontab to update it once a day)
ntpd is mostly used in clustered environments where serveral nodes interoperate with each other and sub-second accuracy on timestamps is significant.
For a single host, running ntpdate every so often should be more than adaquate.
The hardware clock on this 8 year old Dell XPS P3-800 appears to drift by about 6 seconds a day here.
I see your point GazL but "in clustered environments" means that ntpd serves time on other hosts than localhost so it is not a local time server anymore, I mean there are local servers where I can see the usability like X server, cups server but why running a local time server ? I think it is redundant with the system time
keefaz, the difference is that ntpd constantly adjusts the speed of the system clock where as ntpdate makes a step change. Some software will break if you do a step change to the system time, so in those cases you use ntpd, even if only to govern time on the local host.
Say ntpd notices that your system time is 1/10th of a second behind real time. It will do something along the lines of making each of the next 10 seconds last for only 99/100th of a second. So over that 10 seconds you gain 1/10th, but they're gained so slowly that the software doesn't notice. In contrast ntpdate just comes along and goes "Bang!... there's an extra 1/10th for you"
The above figures are for example only, ntpd operates at a much finer interval and takes a long time to apply the adjustments and its a little bit more involved than the way I describe it. If you look at the man page for ntpd, you'll notice that they quote a duration of 14 days to apply an adjustment to the clock of 10 minutes.
The purpose of the ntpd server deamon is not only to communicate the time with other hosts, but to also manage these fine adjustments on the local host.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.