Using Duplicity for Manual Backups In Linux

I use duplicity and an external USB drive to do simple and secure manual backups.

How to Backup

  1. If you're on Ubuntu, skip this step. Duplicity is installed with the default desktop environment. Otherwise, install duplicity.  It's included in most package managers.
  2. Put all of your stuff that you'd like to backup into one directory. In the example below, I used /home/profit/my_data/
  3. Create a temporary directory. In the example below, I used /home/profit/tmp/.  This is required to prevent out of space errors while backing up.
  4. As a normal user, run this command. Replace /home/profit/my_data/ and file:///home/profit/to_hdd/ with your directories.  The file:/// part is the destination.
    duplicity full --tempdir /home/profit/tmp/ /home/profit/my_data/ file:///home/profit/to_hdd/
  5. Type a pass-phrase when it asks.
  6. If it finished with no errors reported, congratulations you've backed up your stuff.  You'll have a directory full of encrypted archives.

How to Restore

Always test that your backup works :) Here's the command to run. Make sure that you're either logged in as root, or as the same user that performed the backup.

Replace file:///home/profit/to_hdd/ with your backup directory and /home/profit/tmp_restore/ with your destination.

duplicity restore --tempdir /home/profit/tmp/ file:///home/profit/to_hdd/ /home/profit/tmp_restore/ 





No comments:

Post a Comment