The Modification Time Problem and a Klugy Solution

Discuss new features and functions
Posts: 5
Joined: 27 Oct 2024

prestonmcafee

I'm new to linux, trying to replace Windows (about 85% there). Ubuntu 24.04 on a Framework 13 laptop.

There are dozens, perhaps hundreds, of posts about inability to synchronize modification times. I edit web files on a laptop and when I have it working as desired, synchronize the folder to the web host. Previously I used WINSCP, which synchronizes file modification times, so I know it is possible on my webhost (inmotionhosting). With Freefilesync, I get the error that the modification time cannot be changed.

What works as a klugy solution is this. I first synchronize from local to webhost. If I have the time, I'll synchronize contents (takes over an hour) but 'time and size' works fine. At this point the two locations are identical except the modified files have newer times on my webhost. Then I reverse the synchronization, and synchronize size and time from webhost to local, which synchronizes the file times to the old times.

This is a klugy solution but it actually works pretty well in practice, especially because the second synchronization happens when I am doing something else. The only downside is running the modified files twice -- once up, once down.

I wonder if this double-sync would be a reasonable feature to add to the donation edition, which is where synchronization lives. That is, the "synchronize file times option" first tries to sync the target, but if an error is thrown up, synchronizes the local file modification time to the target's time? That would run almost as fast because it only moves the file once and eliminates the second step my two-step process.

BTW, one great thing about linux over windows is that winscp gets the file size from windows, which is different on ascii files than linux, so 'synchronize file time and size" unnecessarily synchronizes all the ascii files, which in my case is over 40K files. In linux, all the file sizes agree. So even with the modification time problem, my web development is substantially faster on linux. I need to use file size as well as time because a program I use to edit the metadata of photos doesn't change the modification time, so time is not an exact measure of what changed.
Posts: 5
Joined: 27 Oct 2024

prestonmcafee

Sorry, my klugy solution synchronizes local to the new times, not the old times.
Posts: 1042
Joined: 8 May 2006

therube

the file size from windows, which is different on ascii files than linux
Run that by me again?
A copied file should maintain its' size.

A file modified under a different OS, & if that modification also changes line endings, will (may) change the file size (as different OS use different line endings, which take different amounts of space).

Line Breaks in Windows, UNIX & Macintosh Text Files
Posts: 1042
Joined: 8 May 2006

therube

> inmotionhosting

Tell us more.
In what manner are you connect to InMotion with FFS?
Posts: 5
Joined: 27 Oct 2024

prestonmcafee

Yes, that is the size issue. When you use text transfer, the windows version gets \r\n and the linux server just \n.

https://winscp.net/eng/docs/faq_transfer_size_change#google_vignette

I'm just FTPing into inmotion. I do this by creating an FTP connection in Files, which shows up as a folder, and then navigate to it in FFS. As I said, I am a newbie at Linux so if this isn't an ideal approach, please let me know.

I think my use case is going to be easily handled with command line. I already run a bash file to process images and other information on the site. Once that completes, I can have the same file run an upload followed (if the exit state is 0) by an identical download, which results in a fully synchronized state.