Slackware This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
05-12-2006, 02:13 PM
|
#1
|
Member
Registered: Dec 2005
Distribution: Slackware 13.1
Posts: 82
Rep:
|
How do I use timeservers?
My laptop seems to lose a few minutes everyweek while running, how do i use the time servers to automatically sync my time with a more accurate source? A command line way of doing this is preferred, GUI's are for web browsing and watching movies 
|
|
|
05-12-2006, 02:22 PM
|
#2
|
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094
|
On debian I installed ntp (or ntpclient) and then set the config file to sync to a server on the web. Not sure if it comes by default on slackware or whether you need to find a package online...
|
|
|
05-12-2006, 02:50 PM
|
#3
|
Member
Registered: Aug 2005
Location: Bavaria, Germany
Distribution: Slackware (Current)
Posts: 225
Rep:
|
I added a line to my /etc/rc.d/rc.local:
Code:
netdate time.fu-berlin.de &
Then with every boot process the time is syncronized with this timeserver (Germany). Add your timeserver and enjoy ...
Fluxx.
|
|
|
05-12-2006, 03:44 PM
|
#4
|
Member
Registered: Dec 2005
Distribution: Slackware 13.1
Posts: 82
Original Poster
Rep:
|
I figured out a good way to do it, i made a script /etc/cron.daily/date to run netdate ntp0.cornell.edu so that should run every day right?
|
|
|
05-12-2006, 05:31 PM
|
#5
|
Member
Registered: Oct 2003
Location: Heidelberg, Germany
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345
Rep:
|
I highly recommend a quick read of the materials available at www.ntp.org. An in-depth knowledge of Internet and network timekeeping is not necessary for keeping your laptop's time set accurately, but a quick read-through of the materials available at that site will give you a good overview.
There is also a list of publicly available timeservers which you can use to keep you system clock accurate. By using more than one clock, you can gain greater accuracy. (But then again, if you are a millisecond off, who's going to know?!)
Anyway, I run netdate as a cron job on a desktop system. With your laptop, which probably gets booted more often, an entry in rc.local listing one server is probably sufficient.
|
|
|
05-12-2006, 07:23 PM
|
#6
|
Member
Registered: Aug 2004
Distribution: Slack10 & curr. tried numerous
Posts: 189
Rep:
|
Or if you don't want to always knock on the same door (with possibly larger skews from getting a distant server from the pool). Add this line to your laptops /etc/rc.d/rc.local.
Code:
/usr/sbin/ntpdate -v us.pool.ntp.org
|
|
|
05-12-2006, 08:31 PM
|
#7
|
Senior Member
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132
Rep:
|
/etc/ntp.conf
Code:
# Sample /etc/ntp.conf: Configuration file for ntpd.
#
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 0. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition.
#
#server 127.127.1.0 # local clock
#fudge 127.127.1.0 stratum 10
#
# Drift file. Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
#
#driftfile /etc/ntp/drift
#multicastclient # listen on default 224.0.1.1
#broadcastdelay 0.008
#
# Keys file. If you want to diddle your server at run time, make a
# keys file (mode 600 for sure) and define the key number to be
# used for making requests.
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
# systems might be able to reset your clock at will.
#
#keys /etc/ntp/keys
#trustedkey 65535
#requestkey 65535
#controlkey 65535
# Don't serve time or stats or trust anyone else by default (more secure)
#restrict default noquery notrust nomodify
# Trust ourselves. :-)
#restrict 127.0.0.1
#
#
# Here's what Shilo came up with
#restrict default noquery notrust nomodify
restrict default kod notrap nomodify nopeer noquery
#restrict 127.0.0.1
restrict 127.0.0.1
#restrict 192.168.0.0 mask 255.255.255.0
restrict 192.168.0.0 mask 255.255.255.0 kod notrap nomodify nopeer
#fudge 127.127.1.0 stratum 3
#server 127.127.1.0
driftfile /etc/ntp.drift
logfile /var/log/ntp.log
server us.pool.ntp.org
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
Add to /etc/rc.d/rc.local
Code:
# Start ntpd to keep time updated. Added by Shilo 9/5/2004
/usr/bin/echo "Updating Time: /usr/sbin/ntpdate us.pool.ntp.org. 0.us.pool.ntp.org. 1.us.pool.ntp.org."
/usr/sbin/ntpdate us.pool.ntp.org. 0.us.pool.ntp.org. 1.us.pool.ntp.org.
/usr/bin/echo "Starting Network Time Protocol Daemon: /usr/sbin/ntpd"
/usr/sbin/ntpd
Alternatively, you can use the above snippet to make a more Slackware-like rc script.
Note that this is for US servers. Adjust accordingly. Also, this is most appropriate for a system that always has a network conection.
Last edited by shilo; 05-12-2006 at 08:33 PM.
|
|
|
All times are GMT -5. The time now is 03:47 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|