Koozali.org: home of the SME Server

sme ftp server setting timestamps of GMT on files with sme ver 7.5.1

Offline purvis

  • *****
  • 567
  • +0/-0
the file upload timestamps are not what i expected using sme ftp server software.

i am uploading some files by ftp to the ftp sme server and the file timestamp is not what i expected.
the file timestamp has GMT time as of the time the upload, and even though i have my servers time set correctly.
i chrooted the user, if that is the term, to a different than the default directory by using the smeaddon
"User Remote Access" from the server manager panel.

i found some notes on the www.proftpd.org web site that seems to point out these issues.
http://www.proftpd.org/docs/howto/Timestamps.html

ftp protocol does not concern itself with keeping the originating ftp transferred file's timestamp.
i am now investigating to see if a change can be made on my sme servers to record the proper date and time of my time zone with all files uploaded.




Offline purvis

  • *****
  • 567
  • +0/-0
Re: sme ftp server setting timestamps of GMT on files with sme ver 7.5.1
« Reply #1 on: April 13, 2011, 01:15:38 AM »
i am a novice so it would nice if a one of the masters of sme would put his approval on this or offer a slightly different approach than i have for resolving my issue with timestamps on files transferred with ftp to a sme server

thanks to mmccarn, i followed his approach for a given answer to another subject on customizing ftp from
http://forums.contribs.org/index.php/topic,47381.0.html

so here is my fix to have files ftp transferred timestamped with the local time.

i picked up the two lines below from different website that made a suggest of adding the two lines into the proftpd.conf file of a linux system
and placed in the proftpd.conf file before the ftp service started.

TimesGMT off
SetEnv TZ :/etc/localtime

instructions:
login as root in a console

make a directory if one does not already exist
Code: [Select]

mkdir -p /etc/e-smith/templates-custom/etc/proftpd.conf/

create a file called "05TimeZone" with the echo command in the above directory created
Code: [Select]

echo '# Set the TZ environment variable to be same as the server time zone
TimesGMT off
SetEnv TZ :/etc/localtime
' > /etc/e-smith/templates-custom/etc/proftpd.conf/05TimeZone


make the custom changes to the smeserver ftp server now and restart the ftp service
Code: [Select]

expand-template /etc/proftpd.conf
sv restart ftp


to reverse what was done above
Code: [Select]

rm -f /etc/e-smith/templates-custom/etc/proftpd.conf/05TimeZone
expand-template /etc/proftpd.conf
sv restart ftp

« Last Edit: April 13, 2011, 01:25:32 AM by purvis »

Offline johnp

  • *****
  • 312
  • +0/-0
Re: sme ftp server setting timestamps of GMT on files with sme ver 7.5.1
« Reply #2 on: April 14, 2011, 12:07:02 AM »
I tried this and my timestamp was correct. What time zone is your server set for?

Code: [Select]
config show TimeZone

Offline purvis

  • *****
  • 567
  • +0/-0
Re: sme ftp server setting timestamps of GMT on files with sme ver 7.5.1
« Reply #3 on: April 14, 2011, 05:17:05 AM »
johnp

it is the timestamps of only files and possibly directories too that are created through use of a ftp transfer.

to see it in action without the modification, just login to your server with a ftp client and upload some files then
take a look at the date/time the files are listed for.

most all ftp programs and the ftp protocol do not transfer the date/time of the file(s) you are transferring to the server
and more than likely a file transferred from a ftp server will have the current date/time when the file is written on the client's side.
this is all normal.

but i would be nice when i am looking at files, i know exactly when the files got put on the server.
i have one program that transfers files once every 7 minutes using a ftp program that i wrote to the sme server and
i use the date/time stamps of files to make sure that is what is happening and what is the most current files transferred using date and time.

it is crazy and hard on the mind to do date and time math on files to figure when the files actually where written on the ftp server.

years ago i realized how import it is to keep the current date and time set on computers  and have the correct date and time stamped on files when all possible.







Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: sme ftp server setting timestamps of GMT on files with sme ver 7.5.1
« Reply #4 on: April 14, 2011, 06:50:50 PM »
it is crazy and hard on the mind to do date and time math on files to figure when the files actually where written on the ftp server.

If you stop using chroot then the timestamps will be correct with the correct timezone offset.

Offline purvis

  • *****
  • 567
  • +0/-0
Re: sme ftp server setting timestamps of GMT on files with sme ver 7.5.1
« Reply #5 on: April 14, 2011, 07:55:04 PM »
Thanks Charlie
i have not studied chroot but i did see what you posted above
in the proftpd.org howto on timestamps.

i loaded the sme addon remote access panel.
I do believe i changed the chroot for only the one user i wanted to access a certain ibay using the remote access panel.
I think i did do things right but i am no expert.
I did not change other users settings.
I internally connected to the ftp server using the admin account and
found the timestamps to be GMT(no timezone offset).
That was my finding.
All my ftp acrivity is in one timezone but if it was not i might prefer a GMT timestamp. 


Offline johnp

  • *****
  • 312
  • +0/-0
Re: sme ftp server setting timestamps of GMT on files with sme ver 7.5.1
« Reply #6 on: April 17, 2011, 03:04:24 AM »
Don't know if this will fix your issue, but you can try it out and report your findings. This should put your TZ value into the config file.

Code: [Select]
SetEnv TZ { $TimeZone }

Offline purvis

  • *****
  • 567
  • +0/-0
Re: sme ftp server setting timestamps of GMT on files with sme ver 7.5.1
« Reply #7 on: April 19, 2011, 09:55:19 AM »
thanks johnp
the second post in this thread solved my issues(wants).