Install Bit Torrent Sync On Ubuntu

Install Bit Torrent Sync on Ubuntu
by Janeth Kent Date: 15-01-2014 torrent ubuntu sync server share


There are some great tools for syncing files over the internet available to us, but one stands out from the rest in regards of technology used and possible use cases.

A public beta version was released in June this year and now it’s available for Windows, Mac, Linux, FreeBSD, Android and iOS. Today we are going to setup BitTorrent Sync on Ubuntu Server. You may need btsync on your server for Backing up configuration and database files, Access code repositories or Create a synchronized documents network folder for your company.

 

 

  1. Go to a temporary folder
    $ cd /tmp
  2. Download the correct version of BitTorrent Sync, depending on your system (i386 or x64)
    $ wget -O btsync.tar.gz http://download-lb.utorrent.com/endpoint/btsync/os/linux-i386/track/stable
    OR
    $ wget -O btsync.tar.gz http://download-lb.utorrent.com/endpoint/btsync/os/linux-x64/track/stable
  3. Unpack the downloaded compressed tar
    $ tar -xf btsync.tar.gz
  4. Now we move the executable to our /usr/local/bin directory
    $ sudo mv btsync /usr/local/bin/
  5. Create a default sync folder
    $ mkdir ~/.sync
  6. We need to create a confguration file for btsync by dumping a sample configuration file
    $ btsync --dump-sample-config > ~/.btsync
  7. Edit the configuration file with
    $ nano ~/.btsync
    and change "storage_path" to reflect the sync folder we created above (Eg /home/yourusername/.sync) and add a username and a password to secure btsync admin panel. Make sure you uncomment the lines containing login information so they are read by btsync
  8. To be able to easily control btsync daemon we need to create a service init.d script and make it executable
    $ sudo touch /etc/init.d/btsync
    $ sudo chmod +x /etc/init.d/btsync
  9. Paste the following content in our /etc/init.d/btsync script and make sure you change the user variable with your username.
    $ sudo nano /etc/init.d/btsync

     

    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides:   btsync
    # Required-Start: $syslog $remote_fs
    # Required-Stop:  $syslog $remote_fs
    # Should-Start:   $local_fs
    # Should-Stop:    $local_fs
    # Default-Start:  2 3 4 5
    # Default-Stop:   0 1 6
    # Short-Description:  btsync - Bittorent SyncApp
    # Description:    btsync - Bittorent SyncApp
    ### END INIT INFO
    
    user="yourusername" # YOU MUST REPLACE THIS BY YOUR USER
    
    group=`id -ng "$user"`
    
    # the full path to the filename where you store your btsync configuration
    config="`su -c 'echo $HOME' $user`/.btsync"
    
    # set of options to run with
    options=""
    
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    DAEMON=/usr/local/bin/btsync
    DAEMON_ARGS="--config $config"
    NAME=btsync
    DESC=btsync
    
    RUNDIR=/var/run/syncapp
    PIDFILE=$RUNDIR/syncapp.pid
    
    test -x $DAEMON || exit 0
    
    if [ -r /etc/default/$NAME ]
    then
      . /etc/default/$NAME
    fi
    
    set -e
    
    case "$1" in
      start)
      echo -n "Starting $DESC: "
      mkdir -p $RUNDIR
      touch $PIDFILE
      chown $user:$group $RUNDIR $PIDFILE
      chmod 755 $RUNDIR
    
      if [ -n "$ULIMIT" ]
      then
        ulimit -n $ULIMIT
      fi
    
      if start-stop-daemon --start --quiet --umask 007 --pidfile $PIDFILE --chuid $user:$group --exec $DAEMON -- $DAEMON_ARGS
      then
        echo "$NAME."
      else
        echo "failed"
      fi
      ;;
      stop)
      echo -n "Stopping $DESC: "
      if start-stop-daemon --stop --retry forever/TERM/1 --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
      then
        echo "$NAME."
      else
        echo "failed"
      fi
      rm -f $PIDFILE
      sleep 1
      ;;
    
      restart|force-reload)
      ${0} stop
      ${0} start
      ;;
    
      status)
      echo -n "$DESC is "
      if start-stop-daemon --stop --quiet --signal 0 --name ${NAME} --pidfile ${PIDFILE}
      then
        echo "running"
      else
        echo "not running"
        exit 1
      fi
      ;;
    
      *)
      echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2
      exit 1
      ;;
    esac
    
    exit 0
  10. Lets make our init.d script start with the server
    $ cd /etc/init.d/ && sudo update-rc.d btsync defaults
  11. Start btsync daemon with the following command and go to http://yourserverip:8888 to add folders you want to synchronize
    $ sudo service btsync start

 

 
by Janeth Kent Date: 15-01-2014 torrent ubuntu sync server share hits : 8522  
 
Janeth Kent

Janeth Kent

Licenciada en Bellas Artes y programadora por pasión. Cuando tengo un rato retoco fotos, edito vídeos y diseño cosas. El resto del tiempo escribo en MA-NO WEB DESIGN END DEVELOPMENT.

 
 
 

Related Posts

Matrix. An open network for secure and decentralized communication that you can install in your Ubuntu server

Imagine to have an open platform that is as independent, vibrant and evolving as the Web itself, but for communication. As of June 2019, Matrix is out of beta, and the protocol…

Linux For Dummies: Permissions

In the previous articles I made a short introduction to the Unix world and in the following article I have dealt with the basic commands for the file system management. Today we are…

Linux for Dummies: Ubuntu Terminal

I introduced in the previous article, available here, the basic concepts concerning the Linux world. Today we are going to have a look to some basic operations that we can perform…

How to setup Free Let’s Encrypt SSL certificates with ISPConfig 3

Let’s Encrypt is an initiative to provide a better way of enabling encryption on websites. It is open, automated and above all: it offers free SSL certificates. Obtaining SSL certificates was always…

The Best RSS Readers for Ubuntu

Even if most of the tech experts actively claim that RSS (Rich Site Summary) is dead especially after Google Reader was discontinued 5 years ago but it isn’t yet as…

Async/Await how they really work: an example

Promises give us an easier way to deal sequentially with asynchrony in our code. This is a welcome addition, given that our brains are not designed to deal efficiently with…

Configuring DNS-over-TLS and DNS-over-HTTPS with any DNS Server

The new DNS-over-TLS (DoT) and DNS-over-HTTPS (DoH) protocols are available for enabling end user's privacy and security given the fact that most DNS clients use UDP or TCP protocols which…

How to install Letsencrypt Certificates with Certbot in Ubuntu

In this article we will explain how to install, manage and configure the SSL Security certificate, Let's Encypt in NGINX server used as proxy. This certificate is free but does…

How to Set up a Fully Functional Mail Server on Ubuntu 16.04 with iRedMail

Setting up your own mail server from scratch on Linux is complex and tedious, until you meet iRedMail. This tutorial is going to show you how you can easily and…

GIMP 2.10 released: Features 32-bit support, new UI and A Ton Of Improvements

It's been over a half-decade since the GIMP 2.8 stable debut and today marks the long-awaited release of GIMP 2.10, its first major update in six years. And among other…

Setting Up SFTP on Ubuntu 16.04

I recently had a request to setup SFTP for a customer so they could manage a set of files in their environment through an FTP GUI. Being an avid user…

Install Java in Ubuntu 16.04

Java and the JVM (Java's virtual machine) are widely used and required for many kinds of software. This article will guide you through the process of installing and managing different…

We use our own and third-party cookies to improve our services, compile statistical information and analyze your browsing habits. This allows us to personalize the content we offer and to show you advertisements related to your preferences. By clicking "Accept all" you agree to the storage of cookies on your device to improve website navigation, analyse traffic and assist our marketing activities. You can also select "System Cookies Only" to accept only the cookies required for the website to function, or you can select the cookies you wish to activate by clicking on "settings".

Accept All Only sistem cookies Configuration