Timezones and file time when FTP uploading

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

rhulsegge
Junior Member
Junior Member
Posts: 8
Joined: 2010-04-11, 19:18 UTC
Location: The Netherlands

Timezones and file time when FTP uploading

Post by *rhulsegge »

Hi,

Multiple times a day I connect to my NAS using TotalCommander FTP. Uploading and downloading works like a Swiss clock :wink:
The only thing that I can't get to work properly is the file date of uploaded files. Here in The Netherlands I have Windows set on the GMT +1 Amsterdam timezone. But when uploading files the file time of the uploaded file is shown in GMT time.
E.g. current Dutch time 21:00 hrs; uploaded file time 20:00 hrs.
When I use internet explorer (of course NOT my favourite tool for FTP) the file time of a file uploaded with iexplorer IS in the correct GMT +1 time. Looking to the file through TotalCommander FTP the time is shown in GMT time, so again the hour setback.

I tried several filename coding settings in the FTP connection details box, but nothing helps.

I use Windows 2000 NL SP4 and Windows XP NL SP3, TotalCommander 7.50a. My NAS uses Linux with EXT4 formatting.

Any suggestions how to solve this?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Can you try with TC 7.55 beta (just for testing, separate directory)? It now supports MLSD and can set the time stamp on uploads. Both functions use GMT, so there should no longer be any time zone problem.
Author of Total Commander
https://www.ghisler.com
rhulsegge
Junior Member
Junior Member
Posts: 8
Joined: 2010-04-11, 19:18 UTC
Location: The Netherlands

Post by *rhulsegge »

Hi again, thanks for your answer!

I have downloaded 7.55 beta as you suggested, and installed it in a different folder. Copying files works as in 7.50a.

Unfortunately the dates are still wrong on the server. I tred all three states of MLSD but it made no difference.

So back to square one...
Henrie
Member
Member
Posts: 194
Joined: 2006-09-03, 23:12 UTC
Location: Volkel, the Netherlands

Post by *Henrie »

I can reproduce this when I set my NAS back to winter time.
But when i set the date on my NAS to summer time (same time as the Win XP computer I work on) I don't get a time difference.
And because I have activated the function on my NAS to synchronise time with a time server daily it always has correct time when I copy my files to it.
Not a bug in my opinion. Date is set by the NAS FTS system.

Win XP Dutch, with TC 7.55pb2 and Synology DS107+ NAS firmware DSM 2.3-1139
rhulsegge
Junior Member
Junior Member
Posts: 8
Joined: 2010-04-11, 19:18 UTC
Location: The Netherlands

Post by *rhulsegge »

Hi Henri,

Thanks for your input.

My NAS also synchronises automatically with a time server each day. It is set to summertime. Nevertheless the hour time difference exists. When I use internet explorer the file times are ok, but when I use TC the hour time difference occurs.
I have tried my XP SP3 notebook with 7.55b2 but that does not help either.
So all are set to summertime and all synchronize time and date regularly. ie does not have the time problem, so I still think the problem lies in the FTP connection through TC...
Sob
Power Member
Power Member
Posts: 941
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

When you're connected to NAS, right-click on any file in FTP panel and select Properties. Raw directory listing will open in Lister. Then look for date in the list and you'll see what exactly the server sends to TC. You can try with both MLSD on and off.
rhulsegge
Junior Member
Junior Member
Posts: 8
Joined: 2010-04-11, 19:18 UTC
Location: The Netherlands

Post by *rhulsegge »

Hi all,

Sob: MLSD on or off does not seem to make any difference here. The time shown in Lister also differs 1 hour.

The NAS that it is all about is a QNAP TS-219P and works fine. The past week I have done some experimenting with connections and file copying:

- I made a network connection in/with Total Commander.
- I copied a file with TC to the NAS.
- File time is now correct.
- I copied another file with TC-FTP to the NAS.
- File time differs 1 hour.
- File time of first copied file also differs 1 hour.
- Both file times show correct in the network connection pane.
- I used both TC 7.50a and 7.55beta and the outcome was the same.
- router: Linksys WRT300N
- PC: W2k NL SP4, wired
- notebook: XP NL SP3, wireless
- NAS: disks use EXT4 format, wired
- My timezone: NL = GMT+1 (Amsterdam, etc.)

My conclusion: the FTP module somehow doesn't take into account either the summertime adjustment or the +1 hour in my GMT+1 timezone.

The hour time difference is very problematic in case of archiving/backing up.

Can anyone tell me is I should change some setting in TC-FTP or if it actually is a bug? And if it is a bug, can/will it be corrected?

Many thanks for your comments.
Sob
Power Member
Power Member
Posts: 941
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

No difference means that the output:
a) is different, but there's no difference in time
b) is exactly the same -> this would mean that server does not support MLSD at all and TC falls back to using old LIST command

Just to be sure, this is typical output of LIST command on Unix server:

Code: Select all

-rw-r--r--   1 username groupname      712 Mar 22 20:47 somefile.ext
while this is output of MLSD:

Code: Select all

Type=file;Size=712;Modify=20100322204743.000; somefile.ext
I have limited access to one different QNAP model and it does not support MLSD, so I guess b) is correct answer.

This QNAP uses ProFTPd 1.3.1rc2 as ftp server and it has an option for GMT times in directory listing. According to ProFTPd manual it's on by default for version >= 1.2.0pre9. It should be off, because it's the usual for LIST command. I'm not sure if all QNAPs have the same software, but lets hope they do. Look for proftpd.conf (/mnt/HDA_ROOT/.config/proftpd.conf in my case) and check for TimesGMT option. If it isn't there, add the line "TimesGMT off" and restart ftp server. Check after restart, that the change is still there, just to be sure.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2rhulsegge
Please press Alt+Enter during a connection to see the raw directory listing. Then compare it to what Sob described to check whether the NAS supports MLSD or not.
Author of Total Commander
https://www.ghisler.com
rhulsegge
Junior Member
Junior Member
Posts: 8
Joined: 2010-04-11, 19:18 UTC
Location: The Netherlands

Post by *rhulsegge »

Pressing Alt+Enter shows what Sob calls the "old LIST command", so the answer is b).

That is the easy part for me. I have no problems to understand the ProFTP alinea, but my technical knowledge how to connect to the QNAP, find the folders Sob talks about and let alone to change the conf file is limited.

I know you can use Telnet or (?) SSH but I don't know these programs. So I need help in that area too I'm affraid...
Sob
Power Member
Power Member
Posts: 941
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

Lets start with the easy and safe part. Download PuTTY, the SSH client (putty.exe from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html). Run it and connect to your NAS. Just enter it's address in "Host Name (or IP address)" field and press Open (SSH and port 22 should be selected by default). New black window will open and ask for username and password. The username should be "admin" and password your main administration password. If login succedes, you should see command prompt:

Code: Select all

[~] #
Try if the config is in the same path as mine:

Code: Select all

ls /mnt/HDA_ROOT/.config/proftpd.conf
If not, find it:

Code: Select all

find / | grep proftpd.conf
When you have the correct location, look at it's content:

Code: Select all

cat /mnt/HDA_ROOT/.config/proftpd.conf
Or just grep for the variable:

Code: Select all

grep GMT /mnt/HDA_ROOT/.config/proftpd.conf
If you get nothing or "TimesGMT on", then server uses GMT time for listing and TC does not expect that. Setting "TimesGMT off" should solve it.

Now comes the harder part. There seems to be only one text editor available on QNAP and it's "vi". And vi is very user unfriendly.
First, make a backup of current config:

Code: Select all

cp /path/to/proftpd.conf /path/to/proftpd.conf.backup
If you somehow manage to destroy the config file, you can go back to original, just swap the arguments:

Code: Select all

cp /path/to/proftpd.conf.backup /path/to/proftpd.conf
Then it's your choice:

1) Find some nice tutorial how to use vi (personally I hate that thing so much that I learned only how to exit from it ;)
2) Copy the config file somewhere else, where you can edit it in user friendly editor and then copy it back. You can use SFTP plugin (http://ghisler.ch/board/viewtopic.php?t=19994) to access the entire filesystem of NAS. The editor you use should understand Unix line endings (almost anything better that Notepad should do) otherwise you'll see just one long line.

If you're not sure about anything, just ask.

---
Edit: Before you start changing anything, it's a good idea to do a little research to see if it can be influenced from administration. Do the safe part to be sure that the wrong option is set. I can't help you much with this, because the NAS that I have access to is not mine and I can't mess with it too much. :)
rhulsegge
Junior Member
Junior Member
Posts: 8
Joined: 2010-04-11, 19:18 UTC
Location: The Netherlands

Post by *rhulsegge »

Sob, you explained everything very clear to me, thanks! Here's what I did:

First I tried the putty connection and that worked. After that excercise I also tried the SFTP plug-in for TC and that worked even better! A whole new world opende up on the QNAP.
I navigated to the foldrer you indicated and there is a file called proftpd.conf

The file contains a line "TimesGMT off"

so the TimesGMT setting is already off.

So, how to proceed from here?
Sob
Power Member
Power Member
Posts: 941
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

Funny thing, I just noticed that I can see it here too. :) I'm in GMT+1 and GMT+2 for DST. ProFTPd shows correct GMT+1 times when they're outside of DST. They're the same in ftp listings and shell directory listings. But times in DST are one hour off. E.g. for right now created directory I have 18:20 in shell but 17:20 in ftp listing.
I can't test it here now, but little googling suggests that the magic command to add to proftpd.conf might be:

Code: Select all

SetEnv TZ :/etc/localtime
If it works, then only one problem remains. I'm not sure how QNAP administration handles updates to proftpd.conf (e.g. when changing user settings), so there is a possibility that the change could be lost. In that case I expect that there must be some other way how to set it somewhere as a default, but I can't help you with that. You'd have better chances in some dedicated QNAP forum. I don't really know that much about it. :)
rhulsegge
Junior Member
Junior Member
Posts: 8
Joined: 2010-04-11, 19:18 UTC
Location: The Netherlands

Post by *rhulsegge »

Hi,

As you suggested I added the line

Code: Select all

SetEnv TZ :/etc/localtime
to proftpd.config

Unfortunately this did not change anything: still the hour time difference.

So I restarted the QNAP to find out if:
- the changes in proftpd.conf will remain or get lost
- if they remain whether this solves the hour time difference or not

Result:
Bummer: the proftpd.conf file is overwritten during rebooting, so the changes are lost.

So now I will try and find out at ProFTP and/or QNAP if they can help.
If they provide the ultimate solution, I will post it here.

Thanks Sob, you have taught me a lot about my NAS, now I am more confident in exploring etc.!
Sob
Power Member
Power Member
Posts: 941
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

The ultimate solution is MLSD command because it should always use GMT, so there can't be any confusion. ProFTPd itself does support it (http://www.proftpd.org/docs/modules/mod_facts.html), but QNAP version, at least the one here, does not include it. You can try in shell:

Code: Select all

proftpd --list
So as paying QNAP customer you should ask them nicely about updated version.
Post Reply