SFTP Log file name two hours off

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
Jadon
Posts: 9
Joined: Fri Sep 11, 2015 6:46 pm

SFTP Log file name two hours off

Post by Jadon »

I'm a little stumped on this one. Our SFTP_LOGDIR settings in /<install>/sftp-server.sh are as follows:
--------------------------
# Setup a logfile if not set by the .rc profile
if [[ -z "$SFTP_LOGFILE" ]]
then
tdir=${TMPDIR:-/tmp}
logid=`echo $LOGNAME | tr "[:upper:]" "[:lower:]"`
dte=`date +%j.%H%M%S`
SFTP_LOGFILE=$tdir/sftp-server.$logid.$dte.$$.log
fi
--------------------------
But our log file names are 2 hours behind the creation date, e.g.:

-rw-r--r-- 1 USERIDAB GROUPABC 496 Feb 1 11:09 sftp-server.useridab.032.090939.50794366.log

Any thoughts?
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: SFTP Log file name two hours off

Post by dovetail »

The z/OS Unix date command uses the TZ environment variable to determine the time zone.
If you don't have this set anywhere (correctly), then you many need to export TZ in your /etc/ssh/sftp-server.rc
Jadon
Posts: 9
Joined: Fri Sep 11, 2015 6:46 pm

Re: SFTP Log file name two hours off

Post by Jadon »

Thanks again for the help on this - much appreciated!
Post Reply