Link to home
Start Free TrialLog in
Avatar of Shaun Wingrin
Shaun WingrinFlag for South Africa

asked on

log file time and date different from linux system time and date???

Say, date returns 6 hours ahead of the date and time in the log files? Why and how can I correct it to log as system date?
Avatar of Tintin
Tintin

Which particular log files are you referring to?   The ones controlled by syslog?

Also, which Linux distro are you using and what timezone is it set to?
Avatar of Shaun Wingrin

ASKER

I actually solved it with this:
[root@messaging etc]# rm /etc/localtime
rm: remove regular file `/etc/localtime'? y
[root@messaging etc]# ln -s  /usr/share/zoneinfo/Africa/Johannesburg /etc/localtime
[root@messaging etc]# date
Sun Mar 18 23:22:03 SAST 2012
Didn't work for me - that solution makes my clock 6 hours fast for some reason... the same symptom that's supposed to fix!
try to install ntpd (network time protocol)
#yum install ntpd
and copy any ntp server from pool list, this should be in the file /etc/ntp.conf and check the time with ntpdate command
#ntpdate 0.centos.pool.ntp.org
this should return the correct time. If the times is matching,
start the ntp service,
#service ntpd start
#chkconfig --add ntpd
#chkconfig ntpd on
ASKER CERTIFIED SOLUTION
Avatar of Pierre François
Pierre François
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
/var/lib/ntp/ntp.drift is blank