LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Tags used in this thread
Popular LQ Tags ,

Reply
 
Thread Tools
Old 10-26-2009, 11:05 PM   #1
tdnguyenitvn
LQ Newbie
 
Registered: Jan 2009
Posts: 6
Thanked: 0
Question synchonize time in centos (urgent)


[Log in to get rid of this advertisement]
Dear All,

I'm using VPS with OS CentOS to hosting website, but the time can not synchronize with my time zone.

Who can help me?

Thank you.

Last edited by tdnguyenitvn; 10-26-2009 at 11:12 PM..
windows_xp_2003 tdnguyenitvn is offline  
Tag This Post ,
Reply With Quote
Old 10-26-2009, 11:09 PM   #2
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 219
Thanked: 114
http://www.wikihow.com/Change-the-Timezone-in-Linux

Then, you can keep time current with ntp with a command like:
Code:
ntpdate pool.ntp.org
linuxslackware foodown is offline     Reply With Quote
Thanked by:
Old 10-27-2009, 12:09 AM   #3
tdnguyenitvn
LQ Newbie
 
Registered: Jan 2009
Posts: 6
Thanked: 0

Original Poster
Question

Quote:
Originally Posted by foodown View Post
http://www.wikihow.com/Change-the-Timezone-in-Linux

Then, you can keep time current with ntp with a command like:
Code:
ntpdate pool.ntp.org
I do that before, but it's still can not.

How can i do with crontab to schedule synchronize about 5 minutes?

thank you
windows_xp_2003 tdnguyenitvn is offline     Reply With Quote
Old 10-27-2009, 12:27 AM   #4
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 219
Thanked: 114
As root, do a 'crontab -e'

Then add this line:
Code:
*/5 * * * * /usr/sbin/ntpdate pool.ntp.org 1> /dev/null 2> /dev/null
Save and quit with a ':wq'

Did you follow the link that I posted?
linuxslackware foodown is offline     Reply With Quote
Thanked by:
Old 10-27-2009, 12:54 AM   #5
tdnguyenitvn
LQ Newbie
 
Registered: Jan 2009
Posts: 6
Thanked: 0

Original Poster
Quote:
Originally Posted by foodown View Post
As root, do a 'crontab -e'

Then add this line:
Code:
*/5 * * * * /usr/sbin/ntpdate pool.ntp.org 1> /dev/null 2> /dev/null
Save and quit with a ':wq'

Did you follow the link that I posted?
I follow already but it can not synchronize.

Thank you, i will add this schedule to the crontab.
windows_xp_2003 tdnguyenitvn is offline     Reply With Quote
Old 10-27-2009, 01:01 AM   #6
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 219
Thanked: 114
What makes you say that it cannot synchronize . . . what are you seeing that indicates this to you?
linuxslackware foodown is offline     Reply With Quote
Thanked by:
Old 10-27-2009, 01:45 AM   #7
tdnguyenitvn
LQ Newbie
 
Registered: Jan 2009
Posts: 6
Thanked: 0

Original Poster
Quote:
Originally Posted by foodown View Post
What makes you say that it cannot synchronize . . . what are you seeing that indicates this to you?
The time on my server always run fast than real time.

When i use with your crontab but it still can not run correct.
windows_xp_2003 tdnguyenitvn is offline     Reply With Quote
Old 10-27-2009, 02:10 AM   #8
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 219
Thanked: 114
So, first off, what timezone are you in?
Please post the output of:
Code:
ls -l /etc/localtime
ls -Rl /usr/share/zoneinfo
ntpdate pool.ntp.org
date
ntpdate pool.ntp.org
date
linuxslackware foodown is offline     Reply With Quote
Thanked by:
Old 10-27-2009, 02:34 AM   #9
tdnguyenitvn
LQ Newbie
 
Registered: Jan 2009
Posts: 6
Thanked: 0

Original Poster
ls -l /etc/localtime

lrwxrwxrwx 1 root root 31 Oct 27 10:22 /etc/localtime -> /usr/share/zoneinfo/Asia/Saigon

ntpdate pool.ntp.org
27 Oct 13:33:03 ntpdate[2645]: step time server 221.132.37.28 offset -344.029524 sec

date
Tue Oct 27 13:33:55 ICT 2009
windows_xp_2003 tdnguyenitvn is offline     Reply With Quote
Old 10-27-2009, 03:05 AM   #10
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 219
Thanked: 114
How long does it take to get fast?

I mean, if you run two ntpdate calls back to back, is there a significant offset on the second run?
linuxslackware foodown is offline     Reply With Quote
Old 10-27-2009, 03:37 AM   #11
tdnguyenitvn
LQ Newbie
 
Registered: Jan 2009
Posts: 6
Thanked: 0

Original Poster
Quote:
Originally Posted by foodown View Post
How long does it take to get fast?

I mean, if you run two ntpdate calls back to back, is there a significant offset on the second run?
about 2 seconds. after 5 minutes it will run fast than with real time about 1 minute.
windows_xp_2003 tdnguyenitvn is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
First Time Trying to Get CentOS 5 to Connect Wirelessly Ascendancy5 Linux - Wireless Networking 3 07-29-2009 11:45 AM
Centos 4.0 to 4.2 Download Sites PLEASE HELP URGENT simfukwe Linux - Distributions 2 12-02-2005 01:45 PM
Mandrake 9.1: Hard time installing w/ 9500 Pro - Urgent. RobG Linux - Hardware 4 07-30-2003 03:03 PM
Mandrake 9.1: Hard time installing w/ 9500 Pro - Urgent. RobG Linux - General 1 07-28-2003 11:09 AM


All times are GMT -5. The time now is 07:57 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration