How To Back Up Your Linux Automatically with Dropbox
Steps and alternatives to create a full backup automatically on Linux Systems using Dropbox.
We will see below how to install and configure this option in Ubuntu 16.10.
Step 1: Install Dropbox Uploader in Ubuntu
For this backup process, we will not use the official Dropbox synchronization tool. Instead, we will install Dropbox Uploader which is a BASH script that will take care of the backup process directly to Dropbox with complete security and integrity of the information making the Common Dropbox tasks like upload, download, synchronize, etc.
To make Dropbox Uploader work properly, we must install the git package with the following command:
sudo apt install git
Once the git package is installed, we will execute the following line to download the application:
git clone https://github.com/andreafabrizi/Dropbox-Uploader.git
Next, we accede to the directory of the application running the following:
Execute the following commands to grant permissions and start the application:
sudo chmod +x *.sh+x *.sh ./dropbox_uploader.sh
Then, you need to follow a series of instructions. First, we access Dropbox Developers
There we click on the Create app button and in the options displayed we activate the Dropbox API box, and it will be necessary to define the following aspects:
- Type of access to Dropbox (can be total or a particular folder).
- Indicate a name for the application.
Check the I agree box to accept the license terms and click on the Create app button, the result will be as follows:
Now click on the Generate button located in the Generated Access token field to generate the token that we will enter in the terminal of Ubuntu 16.10.
Now we paste the access token in the Ubuntu terminal:
A message will be displayed confirming this token, which we accept if it is correct. Now we will create the backup directory using the following command:
./dropbox_uploader.sh mkdir Linux-Respaldodropbox_uploader.sh mkdir Linux-Backup
Step 2: Back Up Automatically Ubuntu
We will be able to create scheduled copies for the backup of our information and this it will be necessary to install Cron. Cron is an application that gives us the possibility of making multiple security copies scheduled through commands.
Anacron: sudo apt - get install anacron
Open the following file. Remember that crontab is a file where the list of commands to be executed in the indicated time will be stored .
sudo nano crontab -e
We will enter the following. In this case we are indicating that every Friday (5) the backup of the necessary folders is done at 6:30 am (30 06).
30 06 * * 5 tar -zcvf backup-$(date +%Y-%m-%d).tar.gz /home/solvetic/archivos a respaldar/;/home/solvetic/Dropbox-Uploader/dropbox_uploader.sh upload /home/solvetic/ archivos a respaldar /backup-$(date +%Y-%m-%d).tar.gz Linux-Respaldo 06 * * 5 tar -zcvf backup-$(date +%Y-%m-%d).tar.gz /home/solvetic/archivos a respaldar/;/home/solvetic/Dropbox-Uploader/dropbox_uploader.sh upload /home/solvetic/ archivos a respaldar /backup-$(date +%Y-%m-%d).tar.gz Linux-Backup
Save the changes using the key combination Ctrl + O, and we exit the editor using Ctrl + X.
Dropbox is a useful alternative to back up our information in a safe place and totally in real time; it is also important to remember that Dropbox offers us the opportunity to download a client for Linux in order to take much more control.