December 27, 2020, 10:44pm
I want to be able to add folders to by synced using the command line (Linux) rather than the web GUI. I would prefer to do it in a bash shell in a terminal if possible.
Specifically, what I want to do by command line is accomplish the same action that the “+ Add Folder” button at the bottom of the left side of the web GUI performs.
(Can I also edit a folder by command line? If not, the option in this case is to edit the config file directly.)
So far I only found this related question:
How to create the sync folder without UI (FolderActivity) correctly - Development - Syncthing Community Forum
That wasn’t helpful to my current question.
Shut down syncthing, modify config file, start syncthing.
December 27, 2020, 11:42pm
That’s what I tried and I haven’t been able to get it to work. But from your answer, I see that it
work, so I’ll keep trying. I will report back. should
January 16, 2021, 2:30pm
Did it work out? Trying to achieve programmatic folder addition myself too…
config.xml on a regular basis, so yes, adding folders this way is definitely possible, as long as you know how to modify the XML file programmatically.
January 16, 2021, 6:30pm
Yes, it is working perfectly for me. I use a bash script that updates multiple devices.
January 16, 2021, 7:26pm
so you guys are approaching this via direct config file creation/editing? I just tested the REST API method - seems a little more “proper” to me and it works very well, so I am going with this route instead.
January 16, 2021, 7:27pm
on another note - there are plenty of Ansible playbooks to potentially simplify it further too…
January 16, 2021, 11:37pm
That interests me a lot, and I’m hoping to find time to explore the Ansible approach to managing Syncthing clients soon. I look forward to reading anything you can share on that topic.
January 17, 2021, 1:25am
well, have a look at the Ansible docs
this role looks interesting
this role is a bit old and simple. but might work for basic stuff. it has some slightly more touched up forks too
and another role which looks interesting is
I am only getting started with all of the above so cannot say which works for what but they seem like a decent start…
February 16, 2021, 1:25am
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.