1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Router changes file modification time for some files

Discussion in 'Asuswrt-Merlin' started by Thorton, Jul 16, 2019.

  1. Thorton

    Thorton Regular Contributor

    Joined:
    May 18, 2016
    Messages:
    101
    AC86U (but I also have the same problem with AC87U). Using USB drive attached to router to store files. After I copy files to router via FTP, everything is OK except for files that were modified in late evening (like several minutes before/after midnight).

    For example, if file was modified on 2018-08-26 00:48, router displays its modification date like 2018-08-25, which causes many problems with file sync software because files on router are marked as older, syncing software copies "new" files from computer, router changes modification date again, and the endless story goes on...

    Here's the screen - https://i.postimg.cc/J0TFgvGs/asus-files.png

    Left is computer, right is router. Notice that only files modified around midnight display incorrect modification time on router, while all other files have exactly the same timestamps on both computer and router. Time on the router seems to be correct - using "date" command it outputs exactly the same date/time as my PC does.

    Any suggestions?
     
  2. JDB

    JDB Very Senior Member

    Joined:
    Aug 28, 2016
    Messages:
    815
    Will be something to do with DST I expect.

    What is the output of date? And what is your PC time/time zone?


    Sent from my iPhone using Tapatalk
     
  3. Thorton

    Thorton Regular Contributor

    Joined:
    May 18, 2016
    Messages:
    101
    Code:
    /tmp/home/root# date
    Tue Jul 16 11:47:54 EEST 2019
    My PC displays the same date/time. Timezone on PC is GMT+2, timezone on router is GMT+2 as well. DST on PC is enabled and is in effect now.

    P.S. "Enable local NTP server" is disabled on router, but I guess it's not relate to the issue because it's only relevant if I want local clients to sync time from router, right?
     
  4. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,119
    Location:
    UK
    I think @JDB is probably correct and it's a time zone or DST issue. Your picture on right only shows the date but not the time. I suspect that if you could see the time you would find that all the files had the same time offset.

    What method are you using to view the files with the incorrect time, SMB, FTP, SCP, etc.?
     
  5. Thorton

    Thorton Regular Contributor

    Joined:
    May 18, 2016
    Messages:
    101
    I use Beyond Compare to compare/sync files. Syncing between PC and router via FTP.
     
  6. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,119
    Location:
    UK
  7. Thorton

    Thorton Regular Contributor

    Joined:
    May 18, 2016
    Messages:
    101
    Yes, I was aware of such option, but I just thought the router should report the same date/time as PC when file is copied directly from the PC. Especially because both PC and router have the same timezone and use the same file system (ext4). Oh well, will live with this workaround...
     
  8. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,119
    Location:
    UK
    Try changing use_localtime=YES to use_localtime=NO in the vsftp.conf file.
     
    Swistheater likes this.
  9. Thorton

    Thorton Regular Contributor

    Joined:
    May 18, 2016
    Messages:
    101
    Thank you, will try!
     
  10. Thorton

    Thorton Regular Contributor

    Joined:
    May 18, 2016
    Messages:
    101
    Unfortunately, that didn't work. The most strange thing to me is that such files cause no problems when I sync them between PC and disks attached to the PC, but if disk is attached to router, files modified around midnight always cause problems.
     
  11. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,119
    Location:
    UK
    I think the problem stems from the fact that there is no accepted standard for ftp that allows for setting the timestamp or dealing with time zones/DST.

    For example, if I look at the files on my router's USB drive using SSH they are corrected adjusted for TZ/DST by the terminal session. If I look at the same files using Filezilla they are 1 hour ahead (actually in the future!). But, if I look at the same files using Windows command prompt ftp the timestamps are correctly adjusted and displayed.

    However, if I set use_localtime=NO the times are displayed correctly in Filezilla but are 1 hour in the past (i.e. not adjusted for TZ/DST) in Windows ftp!

    Much easier to use rsync. ;)
     
    Last edited: Jul 17, 2019
    L&LD likes this.