Manually Installing Resilio Sync (rslSync) on the Raspberry Pi
raspbian on the Raspberry Pi
Once raspbian has been installed or imaged it is very simple to setup Bittorrent Sync. Normally I would create an image but as this is so simple I will just include the instructions.
Create Folder for BitTorrent Sync
sudo mkdir -p mkdir /opt/btsync/bin sudo mkdir /opt/btsync/app_files cd /opt/btsync/bin sudo wget http://download-lb.utorrent.com/endpoint/btsync/os/linux-arm/track/stable -O btsync_arm.tar.gz sudo tar -xvf btsync_arm.tar.gz sudo rm -f btsync_arm.tar.gz
Create a Service
sudo vi /etc/init.d/btsync
Copy the following contents into the file.
#! /bin/sh # /etc/init.d/btsync # # Carry out specific functions when asked to by the system case "$1" in start) /opt/btsync/bin/btsync --config /opt/btsync/bin/btsync.conf ;; stop) killall btsync ;; *) echo "Usage: /etc/init.d/btsync {start|stop}" exit 1 ;; esac exit 0
Set appropriate permissions for the new file and set defaults for service.
sudo chmod 755 /etc/init.d/btsync sudo update-rc.d btsync defaults
Configuration File
Create a configuration file with your required settings. Pay special attention to the login and password fields as the default login is username and the default password is password. Also pay attention to the listening value as I have used port 80 which is the default port for HTTP.
sudo vi /opt/btsync/bin/btsync.conf
Add the following contents to the new file.
{ "device_name": "My BitTorrent Sync", "listening_port" : 0, // 0 - randomize port /* storage_path dir contains auxilliary app files if no storage_path field: .sync dir created in the directory where binary is located. otherwise user-defined directory will be used */ "storage_path" : "/opt/btsync/app_files", // uncomment next line if you want to set location of pid file // "pid_file" : "/var/run/btsync/btsync.pid", "check_for_updates" : true, "use_upnp" : true, // use UPnP for port mapping /* limits in kB/s 0 - no limit */ "download_limit" : 0, "upload_limit" : 0, /* remove "listen" field to disable WebUI remove "login" and "password" fields to disable credentials check */ "webui" : { "listen" : "0.0.0.0:80", "login" : "username", "password" : "password" } /* !!! if you set shared folders in config file WebUI will be DISABLED !!! shared directories specified in config file override the folders previously added from WebUI. */ /* , "shared_folders" : [ { // use --generate-secret in command line to create new secret "secret" : "MY_SECRET_1", // * required field "dir" : "/opt/btsync/sync_test", // * required field // use relay server when direct connection fails "use_relay_server" : true, "use_tracker" : true, "use_dht" : false, "search_lan" : true, // enable sync trash to store files deleted on remote devices "use_sync_trash" : true, "sync_trash_ttl" : 365, // Default is 30 days. // specify hosts to attempt connection without additional search "known_hosts" : [ "192.168.1.2:44444" ] } ] */ // Advanced preferences can be added to config file. // Info is available in BitTorrent Sync User Guide. // http://btsync.s3-website-us-east-1.amazonaws.com/BitTorrentSyncUserGuide.pdf }
Mount a USB Hard Disk
There is not much space if just using the inbuilt SD card as storage so have a look at Mount_USB_Device to connect a USB hard disk to your rPi btSync.