LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-19-2014, 02:49 PM   #1
laredotornado
Member
 
Registered: Apr 2011
Posts: 71

Rep: Reputation: 0
Setting correct time


Hi,

I'm using the Amazon flavor of Linux ...

Code:
uname -a
Linux mydomain.org 3.12.33-36.140.amzn1.x86_64 #1 SMP Thu Aug 14 22:00:02 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
I am aware that I can set the date manually using the "date --set" command, but is there a more precise way to keep the date current? The timezone of our server is GMT.

Thanks, - Dave
 
Old 12-19-2014, 03:14 PM   #2
sudowtf
Member
 
Registered: Nov 2013
Posts: 206

Rep: Reputation: 46
install ntp and insure the service autostarts
 
Old 12-19-2014, 11:43 PM   #3
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
First set the system time with date command within few seconds correctness. Then use ntp daemon to set it correctly in 100s of milliseconds.
 
Old 12-20-2014, 02:46 PM   #4
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
Quote:
Originally Posted by laredotornado View Post
is there a more precise way to keep the date current?
Configure date and time in BIOS. Linux takes them from there while booting.
 
Old 12-22-2014, 09:19 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member response

Hi,

Quote:
Originally Posted by laredotornado View Post
Hi,

I'm using the Amazon flavor of Linux ...

Code:
uname -a
Linux mydomain.org 3.12.33-36.140.amzn1.x86_64 #1 SMP Thu Aug 14 22:00:02 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
I am aware that I can set the date manually using the "date --set" command, but is there a more precise way to keep the date current? The timezone of our server is GMT.

Thanks, - Dave
I use a 'time' scrript placed in '/etc/cron.hourly';
Code:
~# cat /etc/cron.hourly/time
#!/bin/sh
#11-06-06 gws use ntp
 /usr/sbin/ntpdate -v 0.us.pool.ntp.org ntp-1.mcs.anl.gov ntp-2.mcs.anl.gov &&hwclock --systohc 
#--hctosys


#/usr/sbin/netdate time.mtco.com && /sbin/hwclock --systohc
Please be courteous and continue to use a 'pool' so as not to load primary time servers.
Hope this helps.
Have fun & enjoy!
 
Old 12-22-2014, 10:51 PM   #6
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
ntpdate is not good for updating live linux. Some programs may not run or crash in the middle or work wrongly. You should use ntpd and not ntpdate from ntp software.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
syslog time wrong - but date returns the correct time? falc410 Linux - Newbie 7 04-05-2020 10:04 PM
[SOLVED] Weird time changes, correct time and date but wrong hour metaschima Slackware 24 08-03-2014 01:14 PM
[SOLVED] 3 ways of setting the time, which is correct? veeruk101 Linux - Newbie 1 10-24-2011 11:17 PM
time on our RH linux FTP server is four hours ahead, but desktop time is correct?? dgr Linux - Newbie 10 10-09-2007 05:42 AM
setting the correct time & timezone from kde? Jelle Debian 8 07-03-2004 10:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:02 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