Box.com is a popular cloud storage service. But unfortunately, the developer does not provide native Linux client application. It is sad but Linux users won’t stop here. With a little effort, we can backup Linux to Box.com cloud storage. So basically in this article, I am going to perform a backup on my Linux to Box.com using rsync. There are several things to do before we can execute the backup procedures.
We recommend you to read the following articles so it’s easier for you.
Steps to Backup Linux to Box.com using Rsync
There are several steps we are going to take on this article:
- Install Box.com client
- Mount Box.com locally
- Configure Rsync for backup
Step 1. Mount Box.com Storage on Linux
On this example, I am going to install Box.com client on Ubuntu 17.10 using Box2Tux. First, download Box2Tux with this command.
git clone https://github.com/alfredobonino/Box2Tux.git
You should now have a new directory Box2Tux. Now cd to the directory and make the box2tux file executable
chmod +x box2tux
You will be asked to enter your Box.com username and password. See the following example;
Now, your Box.com will be mounted. Usually, its mounted under /run/user/999/gvfs/.
Step 2. Backup using Rsync
Using the step 1 above, we should have mounted the Box storage to our local directory. Now, we can use rsync backup command to start backup to Box.com.
Rsync is available on most Linux distribution such as Ubuntu. So we can use it straight away. For more information about rsync commands and usage, please visit rsync official webpage. The following example will backup my /home directory to Box.com storage mounted under /run/user/999/gvfs/
rsync -avv –delete /home /run/user/999/gvfs/backup01
The –delete option will force rsync to delete anything inside backup01 directory if it does not exist in the /home directory. So, this command will result in exactly the same content with the original source. Please note that the –delete use double dash. I don’t know why wordpress automatically converted it to long dash.
That’s it. Now I can save my backup on my Box.com storage directly from my Linux box. This tutorial has been tested on Ubuntu 16.04 and Ubuntu 17.10.