LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux 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


Reply
  Search this Thread
Old 08-27-2003, 08:14 AM   #1
Moses420ca
Member
 
Registered: Jul 2003
Distribution: Ubuntu
Posts: 142

Rep: Reputation: 15
setting my time server (ntp)


How do I set my time to a time server? In mandrake, it was a question during setup.

Thanks for any help.
 
Old 08-27-2003, 01:20 PM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
I use the ntpdate command, the syntax is:
ntpdate server.whatever.com



You can google for a list of servers, Or check the ntp.org homepage.

Cool
 
Old 08-27-2003, 05:39 PM   #3
Moses420ca
Member
 
Registered: Jul 2003
Distribution: Ubuntu
Posts: 142

Original Poster
Rep: Reputation: 15
I'm sure it works. Thanks. I was wondering how to make this happen like everyday or something. I thought there was just a setting somewhere or a program that mandrake had or something.

On a windoze box:
Code:
c:\>net time /setsntp:time.nrc.ca
On a Linux box:
Code:
drew@workstation1:~> su
Password:
workstation1:/home/drew # ntpdate time.nrc.ca
27 Aug 19:33:31 ntpdate[10335]: no server suitable for synchronization found
workstation1:/home/drew #
Thanks for your help.
 
Old 08-27-2003, 09:29 PM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Actually Mandrake has a tool, it's rdate, here's a page I found for info on using both rdate and ntpdate :
http://twiki.org/cgi-bin/view/Wikile...our_clock_to_a

Cool
 
Old 08-27-2003, 09:57 PM   #5
Moses420ca
Member
 
Registered: Jul 2003
Distribution: Ubuntu
Posts: 142

Original Poster
Rep: Reputation: 15
awesome. I read the whole page. Learned a bit about time. How would I do that command on a schedule? I did this command and it worked.

ntpdate -b -s time.nrc.ca && hwclock --systohc
 
Old 08-27-2003, 10:34 PM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
I'd personally setup a cronjob (maybe I did even, let's check.. Yep!) in /etc/cron.daily if your distro has it (I just realized this may not be in Mandrake ) if not, I'd use crontab to create a cronjob:
crontab -e

To edit your cronjobs, then:
Code:
* 4 * * * /path/to/ntpdate  1> /dev/null
Might be something you wanna use. Check man crontab for more info on that

Cool
 
Old 08-28-2003, 07:22 AM   #7
Moses420ca
Member
 
Registered: Jul 2003
Distribution: Ubuntu
Posts: 142

Original Poster
Rep: Reputation: 15
I found a program called Kcron in my sUsE Kmenu, I used that and it seems to work. Kcron did not ask me for root access and I need root to use this command, ntpdate. Does this matter?
 
Old 08-28-2003, 03:09 PM   #8
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
It probably does, so you'll likely want to set that up after you login as root

Cool
 
Old 08-28-2003, 03:13 PM   #9
Moses420ca
Member
 
Registered: Jul 2003
Distribution: Ubuntu
Posts: 142

Original Poster
Rep: Reputation: 15
you mean, login to X as root? I was always told that was a bad idea. So if that's what you mean, I set all that up, logout and back in as my user and it's all good? The schedule will still run even though root is not logged in?
 
Old 08-28-2003, 03:34 PM   #10
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Well, you can login to X as root, you just want to be careful, do it as little as possible, and try other options first

You can also see if xhost+localhost is already setup on your system and maybe you can run X apps as root in your user's window. Open up a console, su to root, then type:
kcron
And see if it opens it up as root. If it does, cool. Do your thing, save and exit.

If not, feel free to learn about xhost, and/or login as root, startx, do your thing, get out, and do that as little as possible.

I personally use Root's X about, oh, once every other month, for various things. Just wanna be careful with it, and do it as little as possible.

Cool
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NTP Time Server on FC4 jdavidbakr Linux - Software 2 08-25-2005 08:44 AM
Setting up local time server Phaethar Linux - Software 3 06-28-2005 08:45 AM
Setting the system clock to a time server? orange400 Linux - General 4 06-13-2005 01:59 PM
Has the Redhat ntp time server off-line pwalden Red Hat 3 04-08-2004 11:58 PM
Setting up ntp server triley Linux - Networking 0 01-28-2004 01:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration