Whatbox Logo
Login for certain variables to be updated with your slot's information

Wiki > Syncthing

Syncthing is an open-source peer-to-peer synchronization tool.

Two random port numbers between 10000 and 32767 are needed for Syncthing to operate properly. The port numbers 27878 and 13939 have automatically been generated and will be used throughout this article, but can be changed if needed.

Installation

Syncthing is available as an app on your Manage page. Select Manage Apps next to the slot you want to use Syncthing on. On this page, select Add Syncthing and provide your Whatbox password. After a short wait, you can click Open Syncthing to open Syncthing. You can also access Syncthing from your Manage page.

Usage

The user manual and FAQ for Syncthing operation can be found here.

Automatically Restart (optional)

Below are steps to take to have your Syncthing instance automatically restart if it crashes, or if the server is rebooted.

  1. Make a file to be used for the script. touch ~/syncthing_restart.cron

  2. Edit the file and enter the text below. nano -w ~/syncthing_restart.cron

    #!/bin/bash
    if pgrep -f "/usr/bin/syncthing" > /dev/null
    then
        echo "Syncthing is running."
    else 
        echo "Syncthing is not running, starting Syncthing"
        screen -dmS syncthing /usr/bin/syncthing
    fi
    exit
    
  3. Save the file with Ctrl+x, y and Enter to accept overwriting.

  4. Make the script executable. chmod +x ~/syncthing_restart.cron

  5. Open your crontab. EDITOR=nano crontab -e

  6. Enter the following text at the end of the file.

    @reboot /home/user/syncthing_restart.cron >/dev/null 2>&1
    */5 * * * * /home/user/syncthing_restart.cron >/dev/null 2>&1
    
  7. Save the crontab with Ctrl+x, y and Enter to accept overwriting.