Advanced

How to Set Up an Automatic Backup System on Linux with Dropbox

Posted by damien on · 1 comment
Make Tech Easier; By Derrik Diener
Mail this story
Print this story

You should always have a good backup plan in place to safeguard your data. Here is how you can set up an automatic backup of your Linux system to Dropbox.

Full Story

  Nav
» Read more about: Groups: Linux

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments (1)

There's a link in the article that shows a few options for encrypting the archive file before uploading it to Dropbox.

However, I didn't see GPG listed... so, if someone is interested in using GPG... I would modify the cron line to run this script... Of course, change filenames or locations as needed or wanted.

#!/bin/bash
# Script will create an tar archive and then encrypt that archive with the hardcoded PGP key.
#   After encryption, the archive file will be uploaded to a Dropbox account.
#   A specific PGP subkey can be used by appended a ! at the end of the keyid.

_filename=backup-$(date +%Y-%m-%d).tar.gz tar -zcvf $_filename /home/username/files-or-folders-to-back-up/ gpg --trust-model always -o $_filename.asc -r gpg_public_key -e $_filename

#To use a specific PGP subkey #gpg --trust-model always -o $_filename.asc -r keyid! -e $_filename

/home/username/Dropbox-Uploader/dropbox_uploader.sh upload $_filename.asc Linux-Backup


I generally don't embed scripts in my crontab. I find it more organized and a bit easier to understand and work with if I place my crontab scripts in a separate Bash script location and run those from cron. That way I don't need to edit the crontabs... I can simply edit the scripts directly.

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post