[rhn-users] Re: ls -l command shows different time for files in ssh/telnet and ftp sessions

Cameron Simpson cs at zip.com.au
Wed Jan 19 00:30:18 UTC 2005


BTW, please post plain text only, not HTML and plain text. Thanks.

On 16:49 18 Jan 2005, Fabi?n E. Barco <febarco at colredes.com> wrote:
| Why do the ls -l or dir commands show diferent time for uploads files by ftp
| in ssh/telnet session and ftp session?
| 
| ftp server
| user and password autentication
| upload file
| ls -l file, shows time
| dir  file, shows time same above
| 
| now,
| ssh/telnet server
| user and password autentication
| ls -l file, shows time diferent
| 
| ls -l in ssh/telnet shows diferent time for file that ls -l or dir in ftp
| session.
| 
| I need that the time for files be equal using ls -l or dir in telnet/ssh and
| ftp sessions.

Please elaborate a bit on how they times differ? By whole numbers of hours?
Does one appear "correct" (the same as your own local timezone)?

I conjecture that the system default time zone offset (used by FTP)
and the time zone offset handed to your ssh session differ. UNIX
systems store time internally in seconds since the start of 01jan1970
GMT. They convert it on the fly to whatever timezone your process wants
(expressed by the $TZ environment variable, or via the file /etc/localtime
(a binary data format file specifying timezone info for the system
"default" timezone)). In this way people from different places can do
"ls -l" and see times in their own timezone, which are easy for them to
deal with mentally.

Try this:

	ssh or telnet in, then:
		touch foo
		ls -ld foo

Then also examine foo via "ls" from FTP.
"foo" _should_ have the time "now", whatever that may be when you test this.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

It's there as a sop to former Ada programmers.  :-)
        - Larry Wall regarding 10_000_000 in <11556 at jpl-devvax.JPL.NASA.GOV>




More information about the rhn-users mailing list