Rclone install from source

https://quickbox.io/knowledgebase/rclone-install-from-source/

This is a rough outline on how to install Rclone to your server should work on all QuickBox supported OS


First step is to installing Go ver 1.7
apt-get -y update; apt-get -y upgrade cd ~/

wget https://storage.googleapis.com/golang/go1.7.linux-amd64.tar.gz
sudo tar -xvf go1.7.linux-amd64.tar.gz
rm -rf go1.7.linux-amd64.tar.gz
sudo mv go /usr/local

Second is to set go paths
#edit go paths
export GOROOT=/usr/local/go export GOPATH=$HOME/QB-rclone export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
#to make go paths stay add to bash
nano ~/.bashrc

Third and lastly to install rclone
#installling Rclone
go get -u -v github.com/ncw/rclone; cp ~/QB-rclone/bin/rclone /usr/sbin/ ; sudo chown root:root /usr/sbin/rclone; sudo chmod 755 /usr/sbin/rclone; service ssh restart

source info used to make this
http://rclone.org/install/

2 Likes

@RXWatcher what do you think easy to follow? anything i’m missing?

a couple of ideas…depends if you want to make this version usable by all or not. I don’t have that.

~/bin/ by default is in the path per the .profile so I put rclone in there:

existing code:

set PATH so it includes user’s private bin if it exists

if [ -d “$HOME/bin” ] ; then
PATH="$HOME/bin:$PATH"
fi

my additions:

export GOPATH=$HOME
export PATH=$PATH:/usr/local/go/bin

I have an update script in ~/bin/ that calls this:

go get -u -v github.com/ncw/rclone/…
go get -u -v github.com/ncw/rclone

I can now update for just myself and I dont need sudo but it will drop the rclone binary into ~/bin/

If I wanted to do this for all, I would almost compile in my directory and then rename any existing and copy my new one into /usr/local/bin with the proper permissions. That way if the new one has errors, I can revert back just by renaming rclone to rclone.bad and rclone.bak to rclone. It gives you an out in case the git pull is crud.

Oh, new rclone supports writing…go pull it from source :slight_smile:

update this wiki lol if you see something that can be done better. lol i am not a coder as you can tell.

Thanks that was helpful.
It will be great to add the auto start information as well.