Skip to content

Backups

B2 setup

The setup for the Backblaze B2 backups are based on this write-up (I recommend skipping to the TL;DR).

Bucket creation

  1. Install the Backblaze CLI tools
  2. Create an application key with permissions to create buckets and other keys (I recommend creating temporary keys for this by setting a short expiration time) and authenticate with it
b2 account authorize [applicationKeyId] [applicationKey]
  1. Create a new bucket with lifecycle rules:
b2 bucket create --default-server-side-encryption SSE-B2 --lifecycle-rule '{"daysFromHidingToDeleting": 30, "daysFromUploadingToHiding": null, "fileNamePrefix": ""}' [bucket-name] allPrivate
  1. Create an application key with limited access to your specific bucket (I like to use the same key name as the bucket name):
b2 key create --bucket [bucket-name] [key-name] listBuckets,listFiles,readFiles,writeFiles
  1. Take note of the key ID and its value that are outputted after running the previous command, you will need them to configure autorestic

In case of ransomware, lost data on the bucket can be restored using this software.