Solved

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

Posted on 2012-03-18
6
533 Views
Last Modified: 2012-04-05
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?
0
Comment
Question by:shaunwingin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 37735465
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?
0
 

Author Comment

by:shaunwingin
ID: 37735559
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
0
 
LVL 44

Expert Comment

by:Darr247
ID: 37736194
Didn't work for me - that solution makes my clock 6 hours fast for some reason... the same symptom that's supposed to fix!
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 5

Expert Comment

by:1ly4me
ID: 37736885
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
0
 
LVL 10

Accepted Solution

by:
pfrancois earned 500 total points
ID: 37736943
The date command returns the local time. The timestamp in the log files in in UTM time. It is completely logic that these value differ, except if you are in the GMT timezone.

The SAST (South African Standard Time) is GMT+2.

If you have ntpd running and you adjust the time in an incorrect way, the information contained in the file /var/lib/ntp/ntp.drift will become inconsistent. If the value contained in that file differs a lot from 1.000, your clock will become unstable and introduce crazy jumps in the elapsed time. Check this on your system.
0
 

Author Comment

by:shaunwingin
ID: 37736959
/var/lib/ntp/ntp.drift is blank
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question