This article explains backing up important files to Dropbox in Ubuntu Linux.
Backing up important files to Dropbox in Ubuntu Linux is a great way to secure your important data. This can be your website content, important configuration files, and other files you can’t afford to lose.
By backing up your files to Dropbox, you can ensure your data is safe and accessible from anywhere. Dropbox provides an easy and affordable way to secure your content without investing in expensive backup solutions.
To get started with backing up your files via Dropbox, continue with the steps below:
Install Dropbox on Ubuntu
Before getting the backup process to work, you must download and install Dropbox. Run the commands below to download the Dropbox 64-bit package for 64-bit systems.
cd /tmp && wget https://www.dropbox.com/download?plat=lnx.x86_64 -O dropbox-linux.tar.gz
The 32-bit version of the package can be found below
cd /tmp && wget https://www.dropbox.com/download?plat=lnx.x86 -O dropbox-linux.tar.gz
After downloading the package, run the commands below to extract.
tar xvf dropbox-linux.tar.gz
After extracting the downloaded package, run the commands below to move the content to a location in the /opt/dropbox directory.
sudo mv .dropbox-dist /opt/dropbox
Next, run the commands below to allow Dropbox to authenticate the server
/opt/dropbox/dropboxd
This should launch a Dropbox script to allow you to authenticate the servers. You should see links on the screen to select and paste into your web browser. Then click the Connect button to log on to Dropbox and authenticate. After that, the server can upload and download content from your Dropbox account.
This computer isn't linked to any Dropbox account. Please visit https://www.dropbox.com/cli_link_nonce?nonce=33e0533aa1f33af160154eeb9304703d to link this device. This computer isn't linked to any Dropbox account. Please visit https://www.dropbox.com/cli_link_nonce?nonce=33e0533aa1f33af160154eeb9304703d to link this device. This computer isn't linked to any Dropbox account. Please visit https://www.dropbox.com/cli_link_nonce?nonce=33e0533aa1f33af160154eeb9304703d to link this device. This computer isn't linked to any Dropbox account. Please visit https://www.dropbox.com/cli_link_nonce?nonce=33e0533aa1f33af160154eeb9304703d to link this device. This computer isn't linked to any Dropbox account. Please visit https://www.dropbox.com/cli_link_nonce?nonce=33e0533aa1f33af160154eeb9304703d to link this device.
Click Connect

Create Dropbox Service
Dropbox is installed and ready to use. However, it would be easier to manage if it was a service account. To create a Dropbox service account, run the commands below
sudo nano /etc/systemd/system/dropbox.service
Then, copy the content below and paste it into the file.
[Unit]
Description=Dropbox
After=network.target
[Service]
Type=simple
User=your_ubuntu_user_name_here
ExecStart=/opt/dropbox/dropboxd
ExecStop=/bin/kill -HUP $MAINPID
Restart=always
[Install]
WantedBy=multi-user.target
Save the file and exit.
Now, you should be able to run the commands below to stop, start, and enable Dropbox to start when the server starts automatically.
sudo systemctl stop dropbox.service sudo systemctl start dropbox.service sudo systemctl enable dropbox.service
Backing Up to Dropbox
At this stage, Dropbox is installed, and a folder called Dropbox is created in your home directory. When you go back to automatically backup content, place the content in the ~/Dropbox folder in your home directory, and it should be backed up to Dropbox.
You can also create symbolic links to backup directories and files. for example, to back up the entire document root for Apache2 and Nginx (/var/www/html/), you can run the commands below
ln -s /var/www/html ~/Dropbox
You can do this for any file and directory. So, for example, everything created in the /var/www/html will automatically be backed up to Dropbox.
Enjoy!~
You may also like the post below:
Leave a Reply Cancel reply