Author Topic: FTP Server does not set date time correctly on files  (Read 2773 times)

simonx

  • Calf
  • *
  • Posts: 6
FTP Server does not set date time correctly on files
« on: May 13, 2018, 11:53:09 AM »
Hi - any help with this would be very much appreciated.  I want to use my LinkStation 220 NAS Drive (LS220D) for backup using FTP.  The backup software needs to be able to set the date & time on files that have been backed up, as it uses this information to perform incremental updates.  This doesn't work because the FTP server always sets all files to the upload date.  I have done some research and confirmed that an FTP server has to support an FTP feature called MFMT to do this.  Using FileZilla I have been able to confirm that the LS220D ftp server does support MFMT.  I can also use FileZilla to try to force it to set the file data & time.  Using FileZilla's debugging information, I can see it making a call to the FTP server to set the date & time of a test file.  The relevant part of the listing looks like this (my file is 'readme.txt'):

   Command:   MFMT 20090304103751 readme.txt
   Trace:   CTlsSocketImpl::OnRead()
   Trace:   CFtpControlSocket::OnReceive()
   Response:   550 Unable to handle command

I'm not sure if that 550 is a response to the MFMT.  In any case, the call doesn't work.  The uploaded file has the date & time that it was uploaded and not the date time it should have had.  Is this a bug in the FTP server?  Because if so, it's a very unfortunate one for a backup server!

If anyone can suggest a way of getting the FTP server to correctly set the file date & time I will be very grateful.  Thank you!






oxygen8

  • The Oxy-genuine article
  • El Toro
  • ****
  • Posts: 417
  • Giving you some breathing space.
Re: FTP Server does not set date time correctly on files
« Reply #1 on: May 13, 2018, 12:25:04 PM »
This is not the task of the server.
The client has to do it.
At the example Filezilla:
https://kb.abacusprivatecloud.com/articles/397-Filezilla-FTP-Preserve-Date-and-Time


I use rsync for backups.
A backup from one linkstation to a other with the original firmware uses also rsync.

simonx

  • Calf
  • *
  • Posts: 6
Re: FTP Server does not set date time correctly on files
« Reply #2 on: May 13, 2018, 03:59:18 PM »
Yes I know the client has to do it - if by that you mean that the client has to tell the server to do it.  Which is why I configured my backup software (an ftp client) to tell the ftp server to set the date/time of transferred files to be the same as the modified date/time of the source files.  But that failed.  The transferred files just kept the upload date/time.  I then used the equivalent option in FileZilla (the very option mentioned in the link in your post in fact: "Preserve timestamps of transferred files") to get FileZilla to tell the ftp server to do the same thing.  That also failed.  This option is implemented by FileZilla (a) checking that the ftp server supports the MFMT command (which it says it does) and then (b) using the MFMT command to tell the ftp server to set the date/time in the way I described in my post.  The problem is that this does not work!  The MFMT call appears to just fail.  In any case, the files on the server do not get their date/time values set as they should.  As far as I can see, this appears to be a bug in the ftp server implementation.  Anyone got any ideas about how I can either fix this or work around it?

Thanks for the suggestion about using rsync as an alternative to ftp.  I'm using Windows 10, and I don't believe you can use rsync in Windows 10 with remote storage.  If that's correct, is there any other way of avoiding using ftp?

oxygen8

  • The Oxy-genuine article
  • El Toro
  • ****
  • Posts: 417
  • Giving you some breathing space.
Re: FTP Server does not set date time correctly on files
« Reply #3 on: May 13, 2018, 04:42:59 PM »
Why you do not use windows 10 backup?
(with CIFS, without FTP)

simonx

  • Calf
  • *
  • Posts: 6
Re: FTP Server does not set date time correctly on files
« Reply #4 on: May 14, 2018, 04:21:52 AM »
As far as I know Windows 10 backup only lets you backup to an external hard drive.  I don't believe it will let you backup to a network drive.  In fact, even if it did, that wouldn't work for me because I can't see the NAS drive as a network drive.  I believe this is because SMB 1.0 has been disabled, but I'm not sure.  I tried enabling SMB 2.0 on the NAS drive and that momentarily seemed to work (sort of - I could at least see the NAS drive if I typed in the host name into the address bar like this \\hostname) but even that has now completely stopped worked and I can't now see the NAS drive at all as a network drive from Windows 10 (although I can from a Windows 7 PC).

For interest, the reason SMB 1.0 was disabled is because it's unsafe and leaves your network exposed to attacks.

oxygen8

  • The Oxy-genuine article
  • El Toro
  • ****
  • Posts: 417
  • Giving you some breathing space.
Re: FTP Server does not set date time correctly on files
« Reply #5 on: May 14, 2018, 04:27:35 AM »
Windows backup is able to use all available drives

you can use a drivekletter or the unc name

\\nas
\\192.168...



after suspend the LS220D disables smb2

from:
http://forum.nas-hilfe.de/buffalo-linkstation-duo/ls-220d-nas-vergisst-nach-dem-sleep-modus-das-smb2-protokoll-t2737.html


disable suspend and reactivete SMB2
« Last Edit: May 14, 2018, 04:32:29 AM by oxygen8 »

simonx

  • Calf
  • *
  • Posts: 6
Re: FTP Server does not set date time correctly on files
« Reply #6 on: May 14, 2018, 05:08:31 AM »
Hi - yes thank you.  I confirmed the same thing just after I posted back to you.  I will look into the using windows 10 backup.  It may be the way to go.  Still think that Buffalo should sort out the date issue with their ftp server though.  Anyway - thanks for the help.  Much appreciated.

simonx

  • Calf
  • *
  • Posts: 6
Re: FTP Server does not set date time correctly on files
« Reply #7 on: May 16, 2018, 05:18:19 AM »
Just a follow up on this.  I have tried using network connections for backup.  The problem I've found is twofold: first, I can't get network access to my Buffalo NAS drive (LS220D) to work at all unless I enable SMB 1.0, and Microsoft say that SMB 1.0 is unsafe, leaves you vulnerable to virus attacks (including ransomware attacks) and should be disabled (note: enabling SMB2 on the NAS drive doesn't seem to make any difference to this that I could see).  Second, even if you ignore Microsoft warnings and enable SMB 1.0 anyway, network access (at least from Windows 10) is flakey and unreliable.  On a good day, it works (and incidentally, when it works it sets the date & time on backed up files correctly).  But very often it stops working - as it has done for me just now.  Rebooting does not solve the problem.  Resetting my network adapter on my Windows 10 PC probably would but I can't be doing that every day.

So that's my choice: backup using ftp (connection seems to be reliable, but ftp server has a bug that prevents date & time being set correctly on files, which means that incremental backups don't work); or backup using a network connection which does set date & time correctly, but which is flakey and very unreliable.

There may be other options which allow me to use ftp and back everything up to a single file (and therefore manage the date-time issue themselves, avoiding the problem with the ftp server).  But I don't want that sort of solution because I want to able to easily browse and access my own backed-up files as ordinary files and folders - preferably using File Explorer is that would only work reliably.

Could someone from Buffalo Support step in at this point and suggest a solution please?  My questions are:

(1) How can I get network access to the NAS drive to work reliably from Windows 10 (preferably without needing SMB 1.0)
(2) How I can set the date-time on files correctly (essential for incremental backups) if I connect using FTP?

Answers to either or both questions would be very much appreciated.  Thank you!

davo

  • Really Big Bull
  • VIP
  • *
  • Posts: 6149
Re: FTP Server does not set date time correctly on files
« Reply #8 on: May 16, 2018, 06:02:36 AM »
Enable SMB2 on the admin page => File Sharing -> SMB.
PM me for TFTP / Boot Images / Recovery files  LSRecovery.exe file.
Having network issues? Drop me an email: info@interwebnetworks.com and we will get it fixed!

simonx

  • Calf
  • *
  • Posts: 6
Re: FTP Server does not set date time correctly on files
« Reply #9 on: May 16, 2018, 09:09:40 AM »
I did that.  It doesn't make any difference that I can see.

oxygen8

  • The Oxy-genuine article
  • El Toro
  • ****
  • Posts: 417
  • Giving you some breathing space.
Re: FTP Server does not set date time correctly on files
« Reply #10 on: May 16, 2018, 01:36:52 PM »
Quote
network access (at least from Windows 10) is flakey and unreliable.

SMB or FTP is not your biggest problem.

Which firmware do you use?
« Last Edit: May 16, 2018, 01:52:47 PM by oxygen8 »