1846606 Members
1805 Online
110256 Solutions
New Discussion

Re: Date problems

 
Mike_305
Super Advisor

Date problems

Hi,

We have system running 11.00. When I telnet or rlogin to system and run DATE command I get correct date and when I run remsh from a different system I MDT time zone date. The command I run is "remsh abc date"

Does any one know why. I am not sure I think it looks like NTP problem.

Thanks,

Mike
If there is problem then don't think as problem, think as opportunity.
11 REPLIES 11
Pete Randall
Outstanding Contributor

Re: Date problems

Mike,

Check $TZ on both servers. When you rlogin in you'll be using that server's TZ. When you remsh, your TZ variable will be set to whatever your local system has.

Pete

Pete
A. Clay Stephenson
Acclaimed Contributor

Re: Date problems

This is not an NTP problem because all UNIX boxes in the known universe simply count seconds from the beginning of time - 00:00:00 Jan 1, 1970 UTC. What changes is the manner in which the time is displayed and that is controlled by the TZ variable. When you telnet or login, your .profile is executed; not so for remsh. Try this to get an idea of what is wrong. remsh remote_host echo ${TZ}
If it ain't broke, I can fix that.
Leif Halvarsson_2
Honored Contributor

Re: Date problems

Hi

Is it something withe TZ setting.

remsh echo $TZ
rlogin
# echo $TZ

Do you get the same result ?
I tested this but I get the same TZ and time.
Mike_305
Super Advisor

Re: Date problems

Hi,

Ran the command "remsh abc echo ${TZ} and I get PST8PDT. I started NTP serveices, I hope it doesen't cause the problem.

Thanks,

Mike
If there is problem then don't think as problem, think as opportunity.
Leif Halvarsson_2
Honored Contributor

Re: Date problems


Hi
You perhaps need to define the TZ variable on the remote host.

If using sh define TZ in .profile and run the command in this way (from man remsh):

If the remote shell is /usr/bin/sh, the following command line sets up
the environment for the remote command before executing the remote
command:
remsh otherhost . .profile 2>&- \; command

The 2>&- throws away error messages generated by executing .profile
when stdin and stdout are not a terminal.

If your default shell is csh you can define TZ in your .cshrc file.
Mike_305
Super Advisor

Re: Date problems

Hi,

When I do echo on TZ (echo $TZ) I get the right value. This means that the value is set correctly on host abc.

Thanks,

Mike
If there is problem then don't think as problem, think as opportunity.
Pete Randall
Outstanding Contributor

Re: Date problems

Mike,

So you're saying that TZ is the same on both hosts? There has to be some difference in your environments. As Clay pointed out, remsh is not going to execute your profile, or the system profile (/etc/profile) or anything, so you need to compare env on both machines to find out what's different.

Pete

Pete
Rodney Hills
Honored Contributor

Re: Date problems

Mike,

Since TZ is set correctly when you do a "remsh", this means that date should be behaving correctly.

If TZ were not defined, "date" would use EST. But since you are getting MDT, this is what is set by default in /etc/profile when the file /etc/TIMEZONE is not readable.

Another factor to look at is if the paths are different between using "remsh" versus "telnet". Maybe a different "date" program is being run that isn't dealing with TZ correctly.

do a "remsh abc /usr/bin/date" and see if you get MDT or PDT.

My 2 cents.

-- Rod Hills
There be dragons...
Mike_305
Super Advisor

Re: Date problems

Hi,

Try this command and "remsh abc /usr/bin/date" and still reports MDT timezone.

I think like Microsoft may be reboot will fix.
(HAHA)

Any other idea.

Thanks,

Mike
If there is problem then don't think as problem, think as opportunity.
Mike_305
Super Advisor

Re: Date problems

Hi,

The problem is resolve. I reset the date using set_parms commands.

Thanks for your help.

Thanks,

Mike
If there is problem then don't think as problem, think as opportunity.
Mike_305
Super Advisor

Re: Date problems

thanks
If there is problem then don't think as problem, think as opportunity.