Duplicity Backblaze B2
Posted : admin On 1/29/2022Amazon S3 has been around for more than ten years now and I have been happily using it for offsite backups of my servers for a long time. Backblaze’s cloud backup service has been around for about the same length of time and I have been happily using it for offsite backups of my laptop, also for a long time.
Backblaze offers B2 cloud storage which is similar to and compatible with Amazon S3. The advantage of Backblaze B2 is that you can use a variety of 3rd party integrations/software in order to backup your data. That means you have options when it comes to the software you use to backup. 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. When running Duplicity with Backblaze's B2 as outlined in some articles: duplicity b2://keyID:application [email protected] bucket name Real values hidden, but provided though the Backblaze B2. FEATURE REQUEST Backblaze 1 recently launched a new service - B2 2, as a competing product with Amazon S3 and Google Cloud Storage. In doing so they have created an API with which you can interface to do backups and restores 3. It would be nice if y'all could add B2 as a.
In September 2015, Backblaze launched a new product, B2 Cloud Storage, and while S3 standard pricing is pretty cheap (Glacier is even cheaper) B2 claims to be “the lowest cost high performance cloud storage in the world”. The first 10 GB of storage is free as is the first 1 GB of daily downloads. For my small server backup requirements this sounds perfect.
My backup tool of choice is duplicity, a command line backup tool that supports encrypted archives and a whole load of different storage services, including S3 and B2. It was a simple matter to create a new bucket on B2 and update my backup script to send the data to Backblaze instead of Amazon.
Here is a simple backup script that uses duplicity to keep one month’s worth of backups. In this example we dump a few MySQL databases but it could easily be expanded to back up any other data you wish.
Veeam Backblaze B2

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 | ######################################################################## # Uses duplicity (http://duplicity.nongnu.org/) # Run this daily and keep 1 month's worth of backups ######################################################################## # b2 variables B2_APPLICATION_KEY=application_key ENCRYPT_KEY=gpg_key_id DB_USER='root' DATABASES=(my_db_1 my_db_2 my_db_3) # Working directory ######################################################################## # Make the working directory # Dump the databases fordatabasein${DATABASES[@]};do mysqldump-u$DB_USER-p$DB_PASS$database>$WORKING_DIR/$database.sql duplicity--full-if-older-than7D--encrypt-key='$ENCRYPT_KEY'$WORKING_DIRb2://$B2_ACCOUNT_ID:$B2_APPLICATION_KEY@$BUCKET # Verify duplicity verify--encrypt-key='$ENCRYPT_KEY'b2://$B2_ACCOUNT_ID:$B2_APPLICATION_KEY@$BUCKET$WORKING_DIR # Cleanup duplicity remove-older-than30D--force--encrypt-key=$ENCRYPT_KEYb2://$B2_ACCOUNT_ID:$B2_APPLICATION_KEY@$BUCKET # Remove the working directory |
Backblaze B2 Cloud Storage
Run this via a cron job, something like this:
0 4 * * * /root/b2_backup.sh >>/var/log/duplicity/backup.log |