Confused about initial syncing

I want to use Syncthing to sync mostly configuration files, but some data, between systems on my LAN. For now, I have two Macs that I’ll be using, Study and Workshop (call 'em that for convenience). Eventually I may be including more Macs or Linux systems. I’ve already used rsync to sync most of the files on the two Macs, but some of the files on Study have been altered. It’s possible some configuration files on Workshop have been rewritten by the programs that use them, but they haven’t been changed. In short, when I first start using Syncthing, I want Study to be the “master” for all the files (just in case some config files on Workshop have a later timestamp.)

My understanding, from reading the FAQ is that Syncthing can watch for changes, but I can also have it do regular scans of the directories I want synced to look for changes. But I also want to be sure I understand how syncing works, in case my understanding isn’t correct.

  • Is there a way to make sure, when starting synchronization, that it takes files from a specific computer for the first time?

  • The FAQ talks about CPU usage and makes it sound like it takes significant CPU time to scan directories for file changes. Just how much of a resource hog is Syncthing when it’s scanning for changes? (My workshop is in the barn and it takes me about 5-10 minutes between leaving my study and getting down to the barn, so I figured if I scanned some of the configuration directories every 5 minutes, it would make sure if I update files on Study, they’ll be updated and ready for me when I get down to Workshop and will be using them. So I’m wondering if a 5 minute interval would create problems.)

  • Is there a way to force a scan and update? For instance, if I finish with LibreOffice on Study and exit it and am heading to do work on Workshop, can I trigger updates while I’m on one of those machines?

You can set one of the folders on one device to receive only. There is no “I made changes on both devices but I want tge copy from Device X”, it will sync whichever deems to be newest, by some measure of newest. If it thinks changes were made on both sides while the devices were not connected, it will create conflict files.

It’s uses cryptographically secure hashing which os cpu hog. If you have tens of gigabytes of data that is constantly changing or millions of files that are constantly moving around/being added/removed, then yes, it can consume a fair amount of cpu. If you have 300 text files, you won’t even observe it.

You can’t force the other side to “sync”. You can press rescan (although if the folder is on a sensible filesystem, you shouldn’t need to and watching should work), which will trigger detection of changes of files (if there are any, and watching hasn’t picked them up), that will notify the other device about the changes, but you can’t force to do anything. Assuming everything operates as normal, the other device should just sync the changes, but you might not be connected, have no space left, have bad characters that are not supported on the other os, etc, etc, which means things will not sync and there is no way to force anything.

2 Likes

Agreed. You can always force a rescan however the way the software works as soon as you hit file save in your word processor within a matter of seconds the software should detect the file save and begin the synchronization process.

Okay, so I can set up my workshop Mac to receive only at first, give it time to sync, then change to send and receive. That solves my problem!

I don’t think I’ll have a problem once I make sure it’s using the current files on my study computer. My concern, about the timestamps and newest files, is that I might use a program on the workshop computer and it might load and rewrite the configuration file even if I don’t make any changes to it - thus marking it newer. So, as you point out, I can just mark everything on the workshop as receive only. Once it’s all synced up, I can change it.

When this happens, do I get any kind of notification? If so, on all machines involved?

Yes, basically most of what I’m syncing is configuration files which will be text files. I did find some games I use when I’m taking a break have more files than I thought. (Level files recording how I played each level.) But I’m thinking, since that’s just for blowing off steam, I either might not need to bother with those or I can use my own sync-by-hand tool for them. I have a directory of Python scripts and some have the Python byte code files, but that’s small. It sounds like the amount I’m syncing is small enough it wont’ be an issue. Thank you for explaining it to me.

So far this is all on macOS, but I will be including Linux. Any problem with either of those in terms of having to check due to poor alerts of file changes?

That’s going to be nice for me and my situation! My data files are on a NAS share, so they don’t need to be synced. (But I’m also thinking it might be a good idea to sync them between the computers and the NAS - with just me, that would work, but I’m thinking once I have anyone working for me, that might lead to update conflicts - got to think about that.)