Duplicity Backblaze

Posted on  by 



As part of my home DR strategy, I’ve started pushing images of all my virtual machines (as well as my other data) across to Backblaze using Duplicity. If you want to do the same, here’s how you can do it.

Duplicity can store backup data in many destinations, including Backblaze B2. This guide will help you get setup and give you the commands to do a full backup and restore of a specific folder. Set up Duplicity and the backup script on your Raspberry Pi. These instructions assume you use Raspbian. They should be adaptable for use on other Linux (or Linux-like) systems. Install duplicity by running sudo apt-get install duplicity. A simple backup script.

First up, you will need a GnuPG keypair. We’re going to be writing encrypted backups. Store copies of those keys somewhere offsite and safe, since you will absolutely need those to do a restore.

Secondly, you’ll need a Backblaze account. Get one, then generate an API key. This will be comprised of an account ID and an application key. You will then need to create a bucket to store your backups in. Make the bucket private.

Now that’s done, I’m assuming here that you have your /var/lib/libvirt library where your VMs are stored on its own LV. If this isn’t the case, make it so. This is so you can take a LV snapshot of the volume (for consistency) and then replicate that to Backblaze.

Configure the parameters above to suit your environment. You can use gpg --list-keys to get the 8-digit hexadecimal key ID of the key you’re going to encrypt with. The folder name in your bucket you use is arbitrary, but you should only use one folder for one Duplicity target. The 10G LV snap size can be adjusted to suit your environment, but it must be large enough to hold all changes made while the backup is running. I picked 10Gb, because that seems OK in my environment.

Obviously this means I need to have 10Gb free in the VG that the libvirt LV lives in.

Retention here will run incrementals each time it’s run, do a full every 3 months, ditch any incrementals for any fulls except the latest one, and keep up to 4 fulls. With a weekly backup, this will amount to a 12 month recovery window, with a 3-monthly resolution after 3 months, and a weekly resolution less than 3 months. Tune to suit. Drop that script in /etc/cron.daily or /etc/cron.weekly to run as required.

Duplicity

Important. Make sure you can do a restore. Look at the documentation for duplicity restore for help.

You're not a true self-hoster until you've lost your entire configuration at least once. Alex does a deep dive into cloud backup, plus we need your help to find the right Wifi solution for a listener.

Support Self-Hosted

Duplicity Backblaze

Episode Links

Duplicity Backblaze B2

  • LINUX Unplugged 355: Chris' Data Crisis — Chris' tale of woe after a recent data loss, and Wes' adventure after he finds a rogue device on his network.
  • Jupiter Extras: A Chat with mergerfs Developer Antonio Musumeci — mergerfs makes JBOD (Just a Bunch Of Drives) appear like an ‘array’ of drives. mergerfs transparently translates read/write commands to the underlying drives from a single mount point, such as /mnt/storage.
  • Duplicati — Duplicati works with standard protocols like FTP, SSH, WebDAV as well as popular services like Backblaze B2, Microsoft OneDrive, Amazon S3, Google Drive, box.com, Mega, hubiC and many others.
  • restic · Backups done right! — Backing up your data with restic should only be limited by your network or hard disk bandwidth so that you can backup your files every day.
  • Backblaze — Cloud storage that's astonishingly easy and low-cost.
  • How does Backblaze support Linux Users? — There are a variety of options for using Linux with B2. These include open-source (free) and commercial applications, command-line (CLI) and graphical interface (GUI) tools, and tools that include encryption, automation, hybrid NAS/B2 support, mounting remote archives as volumes, and other capabilities.
  • How to configure Backblaze B2 with Duplicity on Linux — Duplicity can store backup data in many destinations, including Backblaze B2. This guide will help you get setup and give you the commands to do a full backup and restore of a specific folder.
  • duplicity — Duplicity backs directories by producing encrypted tar-format volumes and uploading them to a remote or local file server.
  • rsync.net — We give you an empty UNIX filesystem that you can access with any SSH tool
  • Amazon S3 Glacier — Long-term, secure, durable Amazon S3 object storage classes for data archiving, starting at $1 per terabyte per month
  • Installation Methods & Community Guides Wiki - Home Assistant — Today I want to take a step back and take a holistic view of installation methods. What installation methods do we support as a project, and what does supported mean.
  • TiddlyWiki — a non-linear personal web notebook — A unique non-linear notebook for capturing, organising and sharing complex information.




Coments are closed