Timestamp not preserved, what will be the best practice for external storage?

Hi all,

This is not an error I’m facing but I’m looking for some help/suggestions. I’m facing a issue that the timestamp of files are not preserved.

My NC is running natively on a Debian server with a large raid 10 array mounted there. The raid is also configured in smb server so I can access my file on my Windows PC using smb. Thus, I mount the raid as external storage in NC so that the file structure are consistent from different machines.

For a long period of time I used NC smb to connect NC to my array. However I realized that if I upload a file from either NC app or WebUI to my raid, the timestamp (date modified) will be updated to the moment I upload it.

I then switched to the ‘local external storage’ and point the location to the mount point of my raid. In this case the upload is fine, the timestamp is preserved. However all the files created by NC are with owner www-data:www-data, which in my opinion is not so practical. As I want the files editable by other smb clients.

Furthermore, all files downloaded from the WebUI will have the ‘date modified’ as the moment I download it, no matter the file comes from ‘local external’ or smb.

So in short:

  • upload

    • Local external storage: Timestamp preserved, owner www-data
    • SMB: Timestamp not preserver, owner respect smb users.
  • download: no timestamp is preserver.

So I want to have some suggestions: what is the best practice to handle this situation? I don’t want to use my raid as NC primary storage because then the file structure is changed. And also I wish to let NC create files in a different ownership.

Thanks in advance.

Just my 2 pence.

I use Nextcloud with External Storage, with the Windows desktop sync client and Android app. I found it was best to make the external storage as read only, and never to change the files externally of Nextcloud.

All changes / syncs must be done via Nextcloud, that was the only way I found the date stamps were preserved. Event though when written on external storage with current created/mod date, when sync to a client (via the nextcloud or downloaded web interface) the correct modified was written on sync or when downloaded from web client. I think the internal db must keep track of the dates?

Perhaps the internal storage works in the same manner?

Hope this helps anyone with the quest of modified dates.