Backblaze: Difference between revisions
(added section for restoring from backup) |
|||
Line 60: | Line 60: | ||
Because b2 wasn't installed from a trusted OS repository, we execute it as an unprivliged user `b2user`. The following commands shows how to become the `b2user`, list the backups available on the Backblaze B2 `ose-server-backups` bucket, download the archive, decrypt it, and extract its contents. | Because b2 wasn't installed from a trusted OS repository, we execute it as an unprivliged user `b2user`. The following commands shows how to become the `b2user`, list the backups available on the Backblaze B2 `ose-server-backups` bucket, download the archive, decrypt it, and extract its contents. | ||
<pre> | |||
[maltfield@hetzner2 backblaze]$ sudo su - b2user | |||
[sudo] password for maltfield: | |||
Last login: Sat Nov 24 13:10:42 UTC 2018 on pts/124 | |||
[b2user@hetzner2 ~]$ ~/virtualenv/bin/b2 ls ose-server-backups | |||
daily_hetzner2_20181221_111534.tar.gpg | |||
daily_hetzner2_20181222_111516.tar.gpg | |||
daily_hetzner2_20181223_111501.tar.gpg | |||
monthly_hetzner2_20181001_091809.tar.gpg | |||
monthly_hetzner2_20181101_091810.tar.gpg | |||
monthly_hetzner2_20181201_091759.tar.gpg | |||
weekly_hetzner2_20181126_091805.tar.gpg | |||
weekly_hetzner2_20181203_091823.tar.gpg | |||
weekly_hetzner2_20181210_091822.tar.gpg | |||
weekly_hetzner2_20181217_111545.tar.gpg | |||
[b2user@hetzner2 tmp]$ tmpDir="/var/tmp/backblazeRestore_`date +%Y%m%d_%H%M%S`" | |||
[b2user@hetzner2 tmp]$ cd $tmpDir | |||
[b2user@hetzner2 backblazeRestore_20181223_135712]$ ~/virtualenv/bin/b2 download-file-by-name ose-server-backups daily_hetzner2_20181223_111501.tar.gpg daily_hetzner2_20181223_111501.tar.gpg | |||
</pre> |
Revision as of 14:01, 23 December 2018
Usage
Daily (3 day storage), weekly (first day of week), Monthly (first of month, 12 month delete), yearly (Jan 1)
Communication
Hey Marcin,
Can you please add our billing information to our blackblaze account?
Upon further research, I've decided to use Backblaze B2 for storing our backups instead of Amazon Glacier. Though Glacier is slightly cheaper per byte, they require they have a minimum lifetime of 90 days. And S3 (a more expensive & hot cloud storage service from Amazon) has a minimum lifetime of 30 days. Consequently, our bill would be much, much higher than B2 for daily backups (which we'd want to delete after a few days).
- https://wiki.opensourceecology.org/wiki/Maltfield_Log/2018_Q3#Mon_Jul_16.2C_2018
- https://www.backblaze.com/b2/cloud-storage-pricing.html
I'm still estimating the cost of our backups to be about $100/year.
Backblaze appears to be our best option, so I created an account with them. We get 10G of free space on B2, so I've been able to test it over the past few weeks. As of today, I've forked our backup script to just upload the contents of our '/etc' directory (encrypted) to B2 on a daily basis. I created lifecycle rules to delete daily backups after 3 days, weekly backups after 1 month, and monthly backups after 1 year. I'll let this run for probably a couple months to ensure everything is working with the lifecycle rules before we cut over from dreamhost to Backblaze B2.
But for us to actually use B2 for our backups (cutting out dreamhost), we need to give them our billing information (we get only 10G free, but our daily backup is actually >15G).
The credentials for our blackblaze account can be found in our shared ose keepass. In addition to username & password, you'll need to import the 2FA key into your android app. The 2FA secret key is also in keepass.
After logging in, you should be able to click the "Billing" link on the left-hand navigation pane to enter the information.
Thank you,
Michael Altfield Senior System Administrator PGP Fingerprint: 8A4B 0AF8 162F 3B6A 79B7 70D2 AA3E DF71 60E2 D97B
Open Source Ecology www.opensourceecology.org
Restore from backups
This section will describe how to extract data from an encrypted backup file stored in Backblaze B2.
CLI
You can extract data from a backup on Backblaze B2 using their command line utility `b2`.
Because b2 wasn't installed from a trusted OS repository, we execute it as an unprivliged user `b2user`. The following commands shows how to become the `b2user`, list the backups available on the Backblaze B2 `ose-server-backups` bucket, download the archive, decrypt it, and extract its contents.
[maltfield@hetzner2 backblaze]$ sudo su - b2user [sudo] password for maltfield: Last login: Sat Nov 24 13:10:42 UTC 2018 on pts/124 [b2user@hetzner2 ~]$ ~/virtualenv/bin/b2 ls ose-server-backups daily_hetzner2_20181221_111534.tar.gpg daily_hetzner2_20181222_111516.tar.gpg daily_hetzner2_20181223_111501.tar.gpg monthly_hetzner2_20181001_091809.tar.gpg monthly_hetzner2_20181101_091810.tar.gpg monthly_hetzner2_20181201_091759.tar.gpg weekly_hetzner2_20181126_091805.tar.gpg weekly_hetzner2_20181203_091823.tar.gpg weekly_hetzner2_20181210_091822.tar.gpg weekly_hetzner2_20181217_111545.tar.gpg [b2user@hetzner2 tmp]$ tmpDir="/var/tmp/backblazeRestore_`date +%Y%m%d_%H%M%S`" [b2user@hetzner2 tmp]$ cd $tmpDir [b2user@hetzner2 backblazeRestore_20181223_135712]$ ~/virtualenv/bin/b2 download-file-by-name ose-server-backups daily_hetzner2_20181223_111501.tar.gpg daily_hetzner2_20181223_111501.tar.gpg