Objective: Allow Ubuntu to start BTSync on reboot.
Server
- create an EC2 instance, with appropriate storage space.
- Ubuntu LTS 64bit (currently 14.04)
- download the BTSync client
- http://www.bittorrent.com/sync The 64bit linux version.
- dump the btsync.conf
- ./btsync –dump-sample-config > btsync.conf
- edit the btsyn.conf for your settings.
- sudo su
- create /etc/init.d/btsync file
- See below
- chmod 755 /etc/init.d/btsync
- update-rc.d btsync defaults
- service btsync start
- test the connection against other boxes.
Web GUI
- Since we’re on EC2, and security is paramount.
- Establish a port tunnel
- sudo ssh -i ~/.ssh/EC2KEY.pem -L 8888:127.0.0.1:8888 ubuntu@serverHostNameOrIP
- Connect to the system via: http://127.0.0.1:8888/gui
- Verify that all is working on the server end.
Client(s)
- Connect w/the shared keys.
- Verify that the system is working.
- Put a file into the shared folder. Notice that the file should go up to the server.
On the Server EC2 instance.
create the file /etc/init.d/btsync
#!/bin/bash # /etc/init.d/btsync # @see: http://askubuntu.com/a/352240 source if (( $EUID != 0 )); then echo "Please run as root" exit fi # Carry out specific functions when asked to by the system case "$1" in start) /USERACCOUNT/.btsync/btsync --config /USERACCOUNT/.btsync/btsync.conf ;; stop) killall btsync ;; *) echo "Usage: /etc/init.d/btsync {start|stop}" exit 1 ;; esac exit 0
Update 2014-08-23
- changed the init.d script to bash, and added root check.
- Noticed that BTsync does not work well over a VPN connection.
Leave a Reply