Skip to content

Inconsistent modification times on external storage (files_external) #56903

@tervor

Description

@tervor

Tip

Help move this idea forward

  • Use the 👍 reaction to show support for this feature.
  • Avoid commenting unless you have relevant information to add; unnecessary comments create noise for subscribers.
  • Subscribe to receive notifications about status changes and new comments.

Is your feature request related to a problem? Please describe.

I recently tried to bring together my smb network shares and my files in Nextcloud. After some tests I realized the modification time of files uploaded to external storage is always equalling the upload time. In the web ui the file uploaded shows the modification time of the original file uploaded (i.e some days ago) but the actual file on the external storage shows the creation time as the modification time. A file uploaded to the external storage directly (i.e. via smb) keeps the modification time. This leads inconsistent modification times on the external storage which is especially frustrating when dealing with pictures or other time relevant files.

Describe the solution you'd like

I would like files uploaded via Nextcloud to an external storage to keep the modification time of the original file. Just like when uploading to normal "internal" storage.

Describe alternatives you've considered

I tested with smb and sftp as external storage, but the behaviour was the same. The only alternative I could come up with is to do some bind mounting to the internal storage, but this either results in "bad" file ownership (i.e. www-data) or could have strange side effects when mounting smb to an internal storage.

Additional context

Here some stat output from files I tested with:

  • Screenshot_1730744151.png was uploaded via Nextcloud to the configured smb external storage
  • IMAG1140_BURST002_COVER.jpg was uploaded directly via smb to the extenal storage
$ stat Screenshot_1730744151.png 
  File: Screenshot_1730744151.png
  Size: 2166      	Blocks: 9          IO Block: 2560   regular file
Device: 0,101	Inode: 36865       Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1001/    nick)   Gid: ( 2004/   photo)
Access: 2025-12-07 19:05:24.448452138 +0100
Modify: 2025-12-07 19:05:23.446535961 +0100
Change: 2025-12-07 19:05:23.584448502 +0100
 Birth: 2025-12-07 19:05:23.420447812 +0100
$ stat IMAG1140_BURST002_COVER.jpg 
  File: IMAG1140_BURST002_COVER.jpg
  Size: 2674104   	Blocks: 5393       IO Block: 131072 regular file
Device: 0,101	Inode: 38050       Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1001/    nick)   Gid: ( 2004/   photo)
Access: 2025-12-07 19:21:26.640495612 +0100
Modify: 2014-12-18 15:24:28.000000000 +0100
Change: 2025-12-07 19:21:01.772391400 +0100
 Birth: 2025-12-07 19:21:01.608390714 +0100

For reference a file in the internal storage:

$ stat aegis.png 
  File: aegis.png
  Size: 507291          Blocks: 992        IO Block: 4096   regular file
Device: 0,45    Inode: 10419807    Links: 1
Access: (0644/-rw-r--r--)  Uid: (   33/www-data)   Gid: (   33/www-data)
Access: 2025-12-07 22:42:00.406950287 +0000
Modify: 2022-09-18 15:22:42.000000000 +0000
Change: 2025-12-07 22:42:00.359951207 +0000
 Birth: 2025-12-07 22:42:00.342951540 +0000

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapenhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions