time not match
time at syslog not match with machine
localhost:/var/log# tail -f messages Jul 16 19:38:15 localhost -- MARK -- Jul 16 19:58:15 localhost -- MARK -- localhost:~# date Tue Jul 17 09:49:51 ICT 2007 how I resolve? Thank you |
I'm not an expert in this, but nobody has been answering this question, so I'll give it a shot.
pk_kala, there are two ways to specify the applicable time zone: the default way and an optional way. If you have not used the optional way (which I'll describe in a moment), the default way is via file /etc/localtime. It's typically a symbolic link to some specific time zone file. Here's what happens on my machine: Code:
wally:~$ ls -l /etc/localtime I'm about to describe the optional way to set the time zone, as I promised above. A specific process (and all its children) can request the use of a different timezone from that specified by /etc/localtime by setting the TZ environment variable. (TZ stands for "time zone".) This can be done automatically for you, for example, by your shell setup files. You can tell whether you have set TZ by doing this at the shell prompt: Code:
env | grep '^TZ=' I normally don't specify TZ. Here's what happens when I play with that: Code:
wally:~$ ls -l /etc/localtime Finally, as I've promised, I'll discuss how TZ could be set automatically for you, without you knowing it. If the shell you're running is bash (which is true for most Linux users), check the content of the following files. Not all of them exist, but check the ones that do exist:
The period (".") in three of the filenames is important; do not omit it. If you're running some shell other than bash, check the documentation for that shell. Hope this helps. |
My guess would have been that the logging service hasn't been restarted since the system time was changed.. so restarting the logging service would probably sync it's time up to the system time. I have seen this problem before on one of my systems but I can not recall how I fixed it .. reboot ? Restart the services that were logging?
Either way it definitely appeared after I changed the system time. I don't think it's a time zone issues since the listed Timezone is ICT which is a +4 offset and the disparity in the log time vs the system time is only 2 - 2.5 hours or so... I'd be interested to know the solution you find PK_Kala.. my searching came up empty when I tried to verify my answer about the services that are logging needing to be restarted. |
Quoth farslayer:
Quote:
Code:
root:~# date -s 'July 20' Code:
Jul 19 03:33:18 tiger pwdauth[27146]: user `root' entered correct password for `root'. |
All times are GMT -5. The time now is 08:47 AM. |