HOWTO: Install Syncthing From Source on FreeBSD & Run @ Boot Time

Syncthing is great tool! It allows me to sync data across all devices connected via my home network. Windows, FreeBSD, & Android. This HowTo will walk you through a few easy steps that'll have you running Syncthing at boot time as a normal user on your FreeBSD machine.
(Do note, this is an amateur How-To. If there is a more efficient way of executing at boot time, please let me know!)


Install wget (to download syncthing via console)
Code:
# sudo pkg install wget
*** If you don't have sudo installed, log in and run as root


Now, log in as the user that will be running Syncthing.



Download the latest version of SyncThing
Code:
# mkdir ~/Downloads
# cd ~/Downloads
# wget https://github.com/syncthing/syncthing/releases/download/v0.11.6/syncthing-freebsd-amd64-v0.11.6.tar.gz --no-check-certificate

Extract Syncthing tar ball
Code:
# tar xzf syncthing-freebsd-amd64-v0.11.6.tar.gz

Create SyncThing directory (I used the following)
Code:
# mkdir ~/.config/syncthing


Copy syncthing files to new directory
Code:
# cd ~/.config/syncthing
# cp -R ~/Downloads/syncthing-freebsd-amd64-v0.11.6/* ./

Create a Syncthing executable script and store it somewhere safe.
Code:
#!/bin/sh
/usr/home/UserName/.config/syncthing/syncthing


Edit /etc/crontab to run Syncthing script at boot time.
Code:
# sudo vi /etc/crontab
*** Or log in as root to edit /etc/crontab

Add the following line at the bottom of /etc/crontab to execute your Syncthing script
Code:
@reboot    UserName    /safe/script/storage/location/SyncThing.sh
*** UserName is the user you wish to run Syncthing

Save and exit /etc/crontab


That's it! Every time your FreeBSD server restarts, Syncthing will run automatically for the designated user. FYI, Syncthing updates are downloaded automatically via the application. Hope this helps!

~kuan
 
Due to the number of Syncthing updates, the port tends to lag behind. Which wouldn't be a problem, except for the fact that as of version 0.11.4, the built in update feature in the Syncthing port (currently 0.11.5) wasn't working (for me at least). So I turned to the sources code as of yesterday.

Yes the port can be used. Source is just another option.
 
Back
Top