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?
LinuxLinux Distributions
Last Comment
Shaun Wingrin
8/22/2022 - Mon
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?
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
Darr247
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
Also, which Linux distro are you using and what timezone is it set to?