Sync from Windows-Share to MTP-Device (Android Phone) sets modified date to sync date

Get help for specific problems
Posts: 9
Joined: 7 Dec 2016

dave_m

Hello,

I am facing the following problem.

I have synchronized some folders from my MTP device (Android Phone) with my Windows folder share via FreeFileSync on Windows.

For other reasons, it was necessary to perform a hard reset of my Android Phone.

After the hard reset, I synced the folders from my Windows folder share back to my MTP device (Android Phone).

The problem is that all the photos have the modified date of the date they were synced back to the phone and the gallery app is now displaying the dates incorrectly because of this.

Is there anything I can do to resolve this issue?

Regards,
Dave
User avatar
Posts: 3977
Joined: 11 Jun 2019

xCSxXenon

Is there anything I can do to resolve this issue? dave_m, 13 Sep 2024, 18:47
Nope :c
Posts: 9
Joined: 7 Dec 2016

dave_m

Is there anything I can do to resolve this issue? dave_m, 13 Sep 2024, 18:47
Nope :c xCSxXenon, 15 Sep 2024, 14:14
why not?
User avatar
Posts: 3977
Joined: 11 Jun 2019

xCSxXenon

Because MTP doesn't support it
User avatar
Site Admin
Posts: 7170
Joined: 9 Dec 2007

Zenju

Because MTP doesn't support it xCSxXenon, 15 Sep 2024, 20:53
MTP is not the issue, BUT: Google doesn't implement it properly. On some Android phones it works, on others it doesn't, but it isn't a problem with the MTP specification.

FreeFileSync correctly sets the WPD_OBJECT_DATE_MODIFIED attribute, which isn't of much benefit if it is simply ignored by the device. Not fixing this "bug" is most likely a strategic decision by Google so that non-cloud syncs are still supported but don't work "too well".
User avatar
Posts: 3977
Joined: 11 Jun 2019

xCSxXenon

Because MTP doesn't support it xCSxXenon, 15 Sep 2024, 20:53
MTP is not the issue, BUT: Google doesn't implement it properly. On some Android phones it works, on others it doesn't, but it isn't a problem with the MTP specification. Zenju, 16 Sep 2024, 09:13
This is true! For me and many others, it has essentially evolved into an MTP issue for all intents and purposes. In the scope of using MTP to sync data between a phone and a computer, saying it isn't supported is much quicker and easier than explaining the intricacies, although not completely accurate. MTP is rarely used elsewhere
Posts: 28
Joined: 5 Jan 2024

John1234

Hi,

I get good results with FFS when using SFTP to sync wirelessly to my phone.

I use a free SFTP server from Google Play.

https://play.google.com/store/apps/details?id=net.xnano.android.sshserver

Works better that MTP.

Give that a try.
User avatar
Site Admin
Posts: 7170
Joined: 9 Dec 2007

Zenju

saying it isn't supported is much quicker and easier than explaining the intricacies, although not completely accurate. xCSxXenon, 16 Sep 2024, 14:59
Unfortunately that makes it sound as if the issue were with FreeFileSync, when it really is with Google.

And in fact syncing with Android does work correctly in some cases (or even most of the time), so it's wrong to say "MTP isn't supported" in general.
Posts: 9
Joined: 7 Dec 2016

dave_m

Thank you for your answers.

as @John1234 suggested, I will try the SFTP server approach.
Posts: 28
Joined: 5 Jan 2024

John1234

Let me know if you get stuck setting up the SFTP server.
You should add a new user and set a password.
For the Path alias this should work: "Alias:/" and then "/storage/emulated/0". You're phone may differ.
Posts: 9
Joined: 7 Dec 2016

dave_m

thanks for your support.

I prefer an open source variant of an sftp server application. I tried https://f-droid.org/en/packages/org.primftpd/
and the synchronized data has the modification date of today again, so basically no solution.

Any other ideas?

I was thinking about rsync as a last resort. But it seems too complcated. I'm not an advanced IT expert.
Posts: 28
Joined: 5 Jan 2024

John1234

Hi,

The free SFTP server that I recommended allows FFS to preserve all of the original date and time stamps.
I don't have all files with the same date or the date I run the sync.

You can also approach the problem from another direction. There is a program in the Google Play store called "folder sync" and it will let you set up folders to synchronize with an SFTP server on a schedule if you wish, and it will transfer the files and preserve the dates and timestamps.
Posts: 28
Joined: 5 Jan 2024

John1234

@dave_m,

Hi,

I installed the f-droid primitive sftp server and it set the date of each file to today's date, just like it did for you. It's the apps fault.

Try the one I recommended, it works correctly!!
Posts: 9
Joined: 7 Dec 2016

dave_m

@John1234

Hi, thank you for your responses. It's been a busy week, so I haven't had time to look into this topic. In the meantime, I have found another open source application that also works correctly.

SshDaemon:
https://f-droid.org/en/packages/com.daemon.ssh/
https://play.google.com/store/apps/details?id=com.daemon.ssh&hl=gsw

Thank you for your help.

PS: The FolerSync app sounds interesting for other use cases as well.
Posts: 28
Joined: 5 Jan 2024

John1234

@dave_m

You are welcome.

One of the things that's nice about foldersync is that it supports about a dozen Cloud providers including Google and Microsoft and many others so I'm a Microsoft user and have storage on one drive and I can use that program to back up files to OneDrive. It does my text messaging every day at 2:00 a.m.