Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tobeportable
Last active December 17, 2015 06:08
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tobeportable/5562882 to your computer and use it in GitHub Desktop.
Save tobeportable/5562882 to your computer and use it in GitHub Desktop.

Auto Synchronized Backups with Bittorrent sync & a vps

1. Cloud syncing on the cheap

Two awsome things were released yesterday :

Compare this to the pricing of : dropbox pro

Let's pick the familly pictures as an example use case :

  • I want all my pictures to be hosted backed up in the cloud in case something happens to this laptop.
  • I want to share a pictures folder with my sister.

2. Bittorent sync

  1. you pick a folder
  2. you set a secret key for the folder
  3. you either generate it with btscyn
  4. you either paste in a self generated key e.g. longer*
  5. on another box : provided you have the key and btsync : you can sync the folder to any local folder
# *example to generate a longer secure key
for i in {1..5}; do wget -qO- 'http://www.random.org/cgi-bin/randbyte?nbytes=54&format=f' - |\
base64 | tr -d [:space:] ; done ;

3. Bittorent sync on windows

setup

  1. go to http://labs.bittorrent.com/experiments/sync.html
  2. click download, then download for windows
  3. next, next, done : btsync should be in the tray
  4. let's open it
  5. in the preference tab : let's change the device name

add folders to sync

  1. in the share folders tab : press "add"
  2. you set the key (note atm : the ui only let you set a custom longer secret here)

4. Bittorent sync on the vps

setup

cd /usr/local/src/                                                          # folder  
wget http://btsync.s3-website-us-east-1.amazonaws.com/btsync_x64.tar.gz     # download it
apt-get install -y atool                                                    # install archive extractor
aunpack btsync_x64.tar.gz                                                   # unarchive
ln -s `readlink -f btsync` /usr/bin                                         # system wide install

settings

btsync --dump-sample-config > /etc/btsync.conf.json                         # generate config file
vim /etc/btsync.conf.json                                  i                 # start editing config

change these fields :

  • "device_name"
  • "webui"
    • "listen" change the port only
    • "login"
    • "password"

additionally comment or modifiy :

  • "storage_path" : "/home/user/.sync",

run & web config

btsync --config /etc/btsync.conf.json

open a web browser @ vps_ipadress:port

Afer logging in : you can easily :

  • add folder
  • set key
  • select folder
@flexiondotorg
Copy link

If you're running Debian or Ubuntu on the VPS then you can add the BitSync repo and apt-get install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment