Configuring Syncthing without web GUI.

Hi, I’m considering syncthing for this scenario, a central repository on which we will record videos, I need to maintain synchronized some clients (no more than ten, but more realistic is five). The central repository will be the master, the others only clients. The master will be GNU/Linux, clients will be Windows *& or 10, I do not know by now)

I must do all configuration without using the web gui, it will be disabled on both master and clients, so I need to create the configuration xml using bash/perl script and then copy them on the machines.

How can I force synchronization from the master to the client using commandline?

How can I generate the id of the clients using commandline if I need to? I read the description of the ID, if I understand fine, the ID is based on the ssl certificate, so I have to create a ssl certificate for every clients and the server and then apply the procedure. Is there a command to create the id starting from a certificate?

Thanks, Pietro.

You can prepopulate and copy a config.xml to all clients. The actual device ID doesn’t need to be in there, only the device ID of the devices it’s supposed to connect to.

To generate a certificate and print the device ID, see syncthing -generate.

1 Like

Wow, very fast, thanks a lot. I’ll try your suggestion.

Thanks, Pietro.

1 Like

Hi, I made some step forward, so I’m near my target, one last thing:

I have a master repository, every hour I put in it three files, but it maintain all the previous files of several days. Every hour I create on the master repository a .stignore with only files not older than 120 minutes, like this:

!mappa-20160504094001-00.img !mappa-20160504094003-01.img !mappa-20160504094004-02.img !mappa-20160504104001-00.img !mappa-20160504104003-01.img !mappa-20160504104004-02.img *

Client A, inserted now, should synchcronize these six files only The next one hour the .stignore will be:

!mappa-20160504104001-00.img !mappa-20160504104003-01.img !mappa-20160504104004-02.img !mappa-20160504114001-00.img !mappa-20160504114003-01.img !mappa-20160504114004-02.img *

Client A should add the last three files to the other six (so nine) and so on for the following hours.

Client B, inserted now should synchronize only the last six files and so on for the following hours.

Instead on the master repository I have this situation:

 mappe Out of Sync
 Folder Path	/srv/syncthing/mappe/
 Global State	20 items, ~195 MiB
 Local State	6 items, ~58.6 MiB
 Out of Sync Items	14 items, ~137 MiB
 Folder Master	Yes
 Ignore Patterns	Yes
 File Pull Order	Newest First
Override changes

Instead on both the clients I have this situation:

 mappe Up to Date
 Folder Path	/srv/syncthing/mappe/
 Global State	20 items, ~195 MiB
 Local State	20 items, ~195 MiB
 File Pull Order	Newest First

If I do an “override” I will have both the client with the last six files (instead I expected at this point nine on client A and six on client B). How can I do an override using the shell?

Thanks, Pietro.

Check the docs site, rest api section.

I think that is still valid :wink:

use it like any other rest api (see docs for that, apikey is needed since it’s a POST request) using /rest/db/override?folder=someFolder

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.