- Scorch 1 1 2 – Backblaze B2 Storage Client Download
- Scorch 1 1 2 – Backblaze B2 Storage Client Reviews
- Scorch 1 1 2 – Backblaze B2 Storage Client Portal
- DESCRIPTION / SET UP
- METHODS
Backblaze::B2V2Client - Client library for the Backblaze B2 Cloud Storage Service V2 API.
This module should help you create buckets and store/retrieve files in the Backblaze B2 cloud storage service using V2 of their API.
Backblaze makes it easy to sign up for B2 from here:
Basically how you use B2 Cloud Storage is really up to you. There is no one set client you need to use. Backblaze has always been very competitive with their pricing. Their personal backup service only costs (as of this writing) $6.00 USD per month, $60 USD per year or $110.00 USD for two years. Third-party software that has integrated with the B2 service. Quickstart Guide for Backup Assist and B2 Cloud Storage. Quickstart Guide for SoDA and Backblaze B2 Cloud Storage. Quickstart Guide for Archiware P5 Companion App. Quickstart Guide for Weap.IO and B2 Cloud Storage. Quickstart Guide for Synology Cloud Sync and B2 Cloud Storage.
Then enable the B2 service as per these instructions:
Next, visit the 'App Keys' section of the 'My Account' area, and look for the 'Add a New Application Key' button to create an application key. You will need a key with Read and Write access. Be sure to note the Application Key ID as well as the Application Key itself. They do not show you that Application Key again, so copy it immediately.
Please store the Application Key pair in a secure way, preferably encrypted when not in use by your software.
b2_client Command Line Utility
Backblaze::B2V2Client includes the 'b2_client' command line utility to easily download or upload files from B2. Please execute 'b2_client help' for more details, and here are a few examples:
There is also an official command line utility from Backblaze that does a whole lot more:
BackBlaze B2 also has a S3-compatible API
Backblaze has added an S3-compatible API, which you can read about here:
They are continuing to support their native B2 API, so I will continue to use and support this module. I have not tested the S3 modules with Backblaze, but if you already have an S3 integration, it is worth checking out how Paws::S3 or Awes::S3 works with Backblaze.
Scorch 1 1 2 – Backblaze B2 Storage Client Download
Testing Your Credentials
During install, this module will attempt to connect to B2 and download a 16KB file into memory. To test using your B2 account credentials, set these environmental varables prior to attempting to install:
The GUID for a file is displayed when you click on that file's name in the 'Browse Files' section of the B2 UI.
For all the below, when they return $operation_status, that will be 'OK' or 'Error'. If you get 'Error,' check out $b2client->{errors}[-1] .
new
Creates the B2 client object and initiates an API session with B2.
Requires two arguments: the Application Key ID and Application Key obtained from Backblaze.
b2_download_file_by_id
Retrieves a file plus metadata given the GUID of that file. The first argument is required and will be the file's GUID. If you would like to auto-save the file, provide a path to an existing directory as the second argument.
Regardless of auto-save, the file's raw contents will be placed in to $b2client->{b2_response}{file_contents} and the following keys will be populated under $b2client->{b2_response}:
See https://www.backblaze.com/b2/docs/b2_download_file_by_id.html
b2_download_file_by_name
Works like b2_download_file_by_id() except that it expects the bucket name and file name as arguments. The optional third argument is an existing directory path for auto-saving the file.
See https://www.backblaze.com/b2/docs/b2_download_file_by_name.html
b2_upload_file
Macsome spotify downloader 1 0 02. Uploads a new file into B2. Accepts a hash of arguments. The name of the destination bucket must be provided in 'bucket_name'. If you would like to upload a file already saved on disk, specify the complete file path in 'file_location'. Alternatively, if the file is loaded up into a scalar, provide the new file name in 'new_file_name' and assign the loaded scalar into 'file_contents'.
Example 1: Uploading from a file on disk:
Example 2: Uploading when the file is loaded into a scalar:
NOTE: If you are going to use the 'file_contents' method, it's best to load the scalar using the 'slurp_raw' method in Path::Tiny. (I believe 'read_file' in File::Slurp will work, but have yet to test.)
You can also pass a 'content-type' key with the MIME type for the new file. The default is 'b2/auto'.
Upon a successful upload, the new GUID for the file will be available in $b2client->{b2_response}{fileId} .
See: https://www.backblaze.com/b2/docs/b2_upload_file.html
b2_upload_large_file
Uploads a large file into B2. Recommended for uploading files larger than 100MB. Accepts a hash of arguments, which must include the name of the destination bucket in 'bucket_name' and the complete file path of the file in 'file_location'.
Example:
b2_list_file_names
Required input is $bucket_name
as the first parameter (required) and an optional key-value hash of parameters. These parameters can include:
prefix
Allows one to specify a filename prefix or directory path, useful for buckets with a large number of files or many subdirectories. Default is undefined.
delimiter
Allows one to specify what is considered the delimiter for the file path
in the bucket. Default is undefined.
startFileName
Allows one to select where in the file list to start the results, since the max results for each call is 1000 files. This allows one to define the start
for emulating pagination of the results.
maxFileCount
The default is 1000, the ultimate maximum per the specification. The module default may be accessed via the package variable, $B2_MAX_FILE_COUNT
.
Retrieves an array of file information hashes for a given bucket name. That array is added to @{ $b2client->{buckets}{$bucket_name}{files} } and returned as an array reference to the list of file objects.
See https://www.backblaze.com/b2/docs/b2_list_file_names.html , especially the section for 'Response' to see what is included for those file info hashes.
Note that B2 limits this response to 1000 entries, so if you have a very large bucket, you can call this method several times and check the value in $b2client->{buckets}{$bucket_name}{next_file_name} after each call. Permute 3 4 4 esv.
Example 1: Basic call:
Example 2: Basic call and capturing file list:
Example 3: Avoid initial API call to get bucket_id
:
Example 4: Using optional parameters to control results (Note: only $bucket_name
is required):
b2_get_file_info
Given a GUID for a file, will retrieve its info hash and load into $b2client->{file_info}{$file_id}.
See https://www.backblaze.com/b2/docs/b2_get_file_info.html , particularly the section for 'Response' to see what is provided.
Example:
b2_bucket_maker
Creates a new bucket in your B2 account, given the name for the new bucket. The bucket type will be set to 'allPrivate',
Will place the new bucket's ID into:
See: https://www.backblaze.com/b2/docs/b2_create_bucket.html
Example:
Scorch 1 1 2 – Backblaze B2 Storage Client Reviews
By default the new bucket will be set to use the 'Server-Side Encryption with Backblaze-Managed Keys (SSE-B2)' option described here: https://www.backblaze.com/b2/docs/server_side_encryption.html You can send a second param to disable that (not recommended):
Also, if your app key does not have the 'writeBucketEncryption' then encryption will be disabled.
b2_delete_bucket
Deletes a bucket from your B2 account, provided that it is empty. Requires the target bucket's name as the argument.
See: https://www.backblaze.com/b2/docs/b2_delete_bucket.html
Example:
b2_delete_file_version
Deletes a version of a file, AKA a stored object. If you use unique file names for each file you upload, then one version equals one file. If you upload multiple files with the same name under a single bucket, you will create multiple versions of a particular file in B2.
The required arguments are the file name and the file ID.
Example:
b2_talker / b2_get_upload_url / b2_list_buckets
b2_talker() handles all the communications with B2. You should be able to use this to make calls not explicitly provided by this library.
If b2_talker() gets a 200 HTTP status from B2, then the call went great, the JSON response will be loaded into $b2client->{b2_response}, and $b2client->{current_status} will be set to 'OK'.
If a 200 is not received from B2, $b2client->{current_status} will be set to 'Error' and a hash error details will be added to @{ $b2client->{errors} }. That hash usually includes the called URL, the returned status code, and the error message.
Note that the base URL for this API session will be stored under $b2client->{api_url} so that you build a URL like so:
$list_buckets_url = $b2client->{api_url}.'/b2api/v2/b2_list_buckets';
Example of a GET API request:
Example of a POST API request:
Almost all the API calls use the Account Authorization Token for the authorization header, but the file uploader calls require a bucket-specific token and upload URL. You can retrieve these via b2_get_upload_url() with the bucket name as an argument.
Example:
This populates:
Note: You have to call b2_get_upload_url on a bucket for each file upload operation. My b2_upload_file method does that for you, so that's just FYI if you roll your own.
See: https://www.backblaze.com/b2/docs/b2_get_upload_url.html
If you need the ID for one or more buckets, you can use b2_list_buckets. If a bucket name is provided, only that bucket's ID will be retrieved. If no argument is provided, all the ID's will be retrieved for all buckets in your account.
Example:
You now have $b2client->{buckets}{'MyBucketName'}{bucket_id}
See: https://www.backblaze.com/b2/docs/b2_list_buckets.html
This module requires:
In order to get this to work properly on Ubuntu 18.04 and 20.04, I installed these system packages:
B2 API Docs: https://www.backblaze.com/b2/docs/
Backblaze::B2 - V1 API Client for B2
Paws::S3 - If using Backblaze's S3-compatible API.
Eric Chernoff - Please send me a note with any bugs or suggestions.
ESTRABD - Enhanced b2_list_file_names() to fully use options and a great bugfix when using the 'file_contents' option in the b2_upload_file() method.
Scorch 1 1 2 – Backblaze B2 Storage Client Portal
MIT License
Copyright (c) 2021 Eric Chernoff
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. Keepassxc chrome. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Backblaze used to be really simple. Backblaze meant one thing, simple, easy to use cloud backup. Then in September 2015 Backblaze launched B2 cloud storage and went from being synonymous with cloud backup to having a little bit of an identity problem. Is Backblaze cloud backup or is it cloud storage? Backblaze is now both, a personal backup service AND a cloud storage service.
What is the difference?
Backblaze Personal Backup is the initial service that Backblaze launched in 2007. The service includes a desktop client for Windows and Mac computers to automatically backup all the files from those computers to the Backblaze data centers. The service offers unlimited backup and many other features such as backup of USB drives and and restore through the website or on a USB flash drive or hard disk drive. The service, as of this writing, costs $6.00/monnth or $60.00/year.
B2 Cloud Storage is a cloud storage service, similar to Amazon S3. It allows users to access the Backblaze infrastructure to store data at a considerable savings compared to other similar services. It is really made for developers and software to be able to provide a backend cloud storage solution.
How do you use the service?
To get started with Backblaze Personal Backup you can either sign up on their website and download the desktop client or you can download the desktop client for your computer and install it. Eventually you will need to create an account with Backblaze. The software runs on both Windows and Mac computers. You can also restore your data through the Backblaze website. This only allows you to backup data from your computer.
To use B2 Cloud Storage you need an account on the Backblaze website, it can be the same account as a Personal Backup account, but not if you have a business or group account apparently (I have a group account on Backblaze and I cannot turn on B2 Cloud Storage). Once you have a B2 account you need to create a bucket to hold your files. Once that is done you can actually upload and download files via the Backblaze website, but that is not the only way to use your B2 Cloud Storage. Like Amazon S3 storage the beauty of B2 Cloud Storage is you can use any number of tools to upload and download your files. If you want to use B2 to hold your computer backup you can use software like Duplicati or Cloudberry Backup. There are lots of different integrations available with more being built on top of B2 Cloud storage all the time. Basically how you use B2 Cloud Storage is really up to you. There is no one set client you need to use.
Pricing
Backblaze has always been very competitive with their pricing. Their personal backup service only costs (as of this writing) $6.00 USD per month, $60 USD per year or $110.00 USD for two years. Not a great deal of money considering the peace of mind you get knowing that your files are backed up. The best part of the pricing for personal backup is the consistency. No ups and down pricing depending on how much data you transfer.
B2 Cloud Storage however uses a different pricing model, one that is similar to Amazon S3, but considerably cheaper. It takes into consideration how much data you transfer, how much you store and how much you delete. They do have a cost calculator on the Backblaze B2 website to give you an idea of what it is going to cost. If you have a moderate amount of data to backup using B2 might actually save you some money, but the constantly change price based on use is, in my opinion, a reason to not use B2 for backup.
Do You Need Both Backblaze Personal Backup and B2 Cloud Storage?
Possibly, but probably not. If you are just looking to back up your computer or a few computers you probably only need the Backblaze Personal Backup service. If you want more long term storage or want to backup a lot of computers then perhaps B2 Cloud Storage is a better fit for your needs. For the majority of consumers you probably don't need B2 Cloud Storage.