Operating System - HP-UX
1752280 Members
4486 Online
108786 Solutions
New Discussion

Re: ls of ftp and system ls show diffent timestamp

 
jasonK_1
Frequent Advisor

ls of ftp and system ls show diffent timestamp

ls of ftp and system ls show diffent timestamp

Basically ls of ftp show the UTC timestamp, whereas the ls of the server show PST time.  I have the /etc/TIMEZONE in the PST format and my /etc/profile also read from /etc/TIMEZONE then why the javaapplet and ftp (firefox, filezilla, reflection web) show files in UTC timestamp? I want them to show in the PST zone.  

Thanks,
Jason


#uname -a
HP-UX hpsrv1 B.11.11 U 9000/800 587730578 unlimited-user license

# date -u
Tue Feb 14 00:13:29 UTC 2012

#date

Mon Feb 13 16:13:44 PST 2012

# cat /etc/TIMEZONE
TZ=PST8PDT
export TZ


 #echo $TZ

PST8PDT

4 REPLIES 4
Steven Schweda
Honored Contributor

Re: ls of ftp and system ls show diffent timestamp

> Basically [...]

   As usual, showing actual commands with their actual output can be
more helpful than vague descriptions or interpretations.

> [...] ls of ftp show the UTC timestamp, [...]

   Are you talking about the date-time values shown in a DIR/LIST
listing produced by the FTP server (which?) on your HP-UX system?

> [...] and my /etc/profile also read from /etc/TIMEZONE then why the
> javaapplet and ftp (firefox, filezilla, reflection web) show files in
> UTC timestamp?

   FTP clients tend to show the data sent by the FTP server.

>  #echo $TZ
> PST8PDT

   The FTP server process probably cares more about what's in _its_
environment than it does about what's in _your_ environment.

   I don't know where the FTP server gets its environment, and I haven't
tried this, so I know nothing, but if I wished to control its
environment, I'd probably start by writing a shell script which sets the
environment variables as I wished, and then runs the FTP server program.
Then, I'd replace the original FTP server command ("/usr/bin/ftpd ..."?)
in my inetd configuration file ("/etc/inetd.conf"?) with a similar
command which specifies my new script, instead.  (Naturally, the script
should pass its command-line arguments along to the actual FTP server
program.)

Nighwish
Frequent Advisor

Re: ls of ftp and system ls show diffent timestamp

Hi

 

 

Just a check ftp is a insecure service. Try sftp you must configure ssh keys it's easy and secure.

 

 

Regards.

Bill Hassell
Honored Contributor

Re: ls of ftp and system ls show diffent timestamp

The ftpd daemon is run by inetd so the timezone (variable TZ) for ftpd is the one used to start inetd. inetd is started during the rc script sequence.  /etc/TIMEZONE is called as part of the environment  setup (/sbin/rc, /etc/rc.config and auto_parms). Something prior to inetd startup may have unset TZ or assigned it the UTC value. If you don't want to troubleshoot the startup scripts, just add the line:

 

. /etc/TIMEZONE

 at the beginnng of the /sbin/init.d/inetd script. Note carefully: there is a period, then space, then the TIMEZONE filename. This is called sourcing the file and will set TZ before inetd starts.

 

Once you change the /sbin/init.d/inetd script, restart inetd like this:

 

/sbin/init.d/inetd stop
/sbin/init.d/inetd start

 And now your ftp listings will be shown in the current /etc/TIMEZONE value.

 



Bill Hassell, sysadmin
jasonK_1
Frequent Advisor

Re: ls of ftp and system ls show diffent timestamp

Thanks Bill. You nailed it.  Now I need to debug the script to find out why and where!