- Print
- DarkLight
How to Use bzCLI
- Print
- DarkLight
bzCLI is a cross-platform tool designed to enable Remote Monitoring and Management (RMM) systems to configure and administer the Backblaze Backup Client. It provides enterprise IT administrators with the ability to remotely manage backup configurations on client computers without requiring direct user interaction.
The tool follows a Git-style command syntax, offering an intuitive interface with named arguments instead of position-based parameters, making it easier to use correctly and debug when issues arise.
Installation
No separate installation of bzCLI is required. The tool is installed automatically as part of the Backup Client installation.
Installation Paths
Platform | Location |
|---|---|
macOS |
|
Windows |
|
Command Syntax
Two primary syntax forms are supported:
Global Options
bzcli [-h|--help] [-v|--version] [--verbose]Each option begins with a hyphen (-) for short form or double hyphen (--) for long form.
Option | Description |
|---|---|
| Print help message. |
| Print the program version. |
| Print extra debugging information to stderr. |
Command Execution
bzcli <command> [<args>]Where command specifies the operation to perform, followed by optional arguments.
Output and Exit Status
Non-error results are printed to stdout. If an error occurs, bzCLI prints details about the error to stderr. The utility returns 0 on success, or a non-zero value on error.
Commands
action
Causes the backup software to perform a single operation. Only one operation is allowed per command invocation; to run multiple operations, invoke bzcli more than once.
Syntax
bzcli action [--group <groupid:grouptoken>] --<operation> [arguments...]Options
Option | Description |
|---|---|
| Authenticate using a group ID and group token. Required for PEK operations. |
| Start a backup immediately if one is not already in progress. Does not require authentication. |
| Pause a running backup. Does not require authentication. |
| Set a new Private Encryption Key (PEK) for a backup that does not already have one. Accepts one argument: the new PEK. Requires authentication. |
| Clear the existing PEK. Accepts one argument: the current PEK. Requires authentication. |
| Change an existing PEK. Accepts two arguments: the old PEK, followed by the new PEK. Requires authentication. |
Account Authentication
Some action operations require account authentication to prevent unauthorized changes. Provide a group ID and group token separated by a colon:
bzcli action --group groupid:grouptoken --operation [arguments...]This example shows how to set a PEK using group authentication:
bzcli action --group 27194:c24a998252466cb --set-pek foobarPrivate Encryption Key (PEK) Operations
A PEK provides an additional layer of security for backed-up data. When a PEK is set, it is impossible to access backup data without it. If you forget a PEK, Backblaze cannot reset it or recover your data.
To check whether a backup already has a PEK set, run:
bzcli report -v /backup/installation/has_pekThis command returns true or false.
Note
If the Backup Client is actively backing up when you attempt to change the PEK, bzcli may be unable to complete the operation. To avoid this, pause backup first, change the PEK, then resume with --backup-now.
configure
Updates the configuration of Backblaze's backup software using key-value pairs to specify what to change.
Syntax
bzcli configure [-j|--json <filepath>] [--json-example] [-p|--print] [-v|--value <key=val>]Options
Option | Description |
|---|---|
| Apply one or more configuration changes from a JSON input file. |
| Print a sample JSON configuration file. |
| Print the updated configuration without actually applying the changes. |
| Apply a single configuration change as a key=value pair. |
Input Methods
There are two ways to specify configuration changes:
Single value: Use
-vor--valuewith a key=value argument. For example, to change the computer name:bzcli configure -v online_hostname=MyNewComputerNameJSON file: Use
-jor--jsonto apply one or more changes from a JSON input file. Use--json-exampleto print a sample file.
Operation
The configure command validates and parses the input, reads the current bzinfo.xml configuration file, applies the specified settings, and writes the updated configuration back to bzinfo.xml. Unrecognized configuration keys are silently ignored.
Exit Status
Code | Meaning |
|---|---|
| No fatal errors were encountered. |
| One or more fatal errors were encountered (for example, malformed input). |
report
Prints information about Backblaze's backup software and status. Reports any problems analyzing backup status to stderr.
Syntax
bzcli report [--exit-on-error] [-f|--format <format>] [-v|--value <query>]Options
Option | Description |
|---|---|
| Treat all errors as fatal and return a non-zero exit code. By default, many problems (such as malformed XML data) are nonfatal and only reported to stderr. |
| Output format: |
| Report only a single value using a slash-delimited query path into the JSON report. |
Output Format
Reports are output to stdout in JSON format. Two formats are supported:
json — Pretty-printed JSON with line breaks and indentation (default).
minijson — Minified JSON, all on one line with whitespace omitted.
Timestamps
Reports include timestamps in two formats:
gmt_millis — Number of non-leap milliseconds since the Unix epoch (00:00:00 UTC, 1 January 1970).
gmt_time — UTC time in YYYYMMDDhhmmss format.
Timestamps may also be the string none when a value is not applicable. For example, if license renewal has never failed, the renewal failure time is none.
Querying Single Values
Use the -v or --value option with a slash-delimited query path to retrieve a specific value from the report:
bzcli report -v /backup/account/emailIf the query resolves to a JSON object or array rather than a scalar value, the full matching element is printed. For more advanced querying (such as extracting individual values from arrays), pipe the full JSON output to a tool like jq.
Examples
# Get the account email address
bzcli report -v /backup/account/email
# Check whether a PEK is set
bzcli report -v /backup/installation/has_pek
# Get the full report in minified JSON
bzcli report --format minijsonConfiguration Settings Reference
The following settings can be configured using the configure command, either via the -v flag or a JSON input file.
Backup Settings
Key | Description |
|---|---|
| Whether to back up when on battery power. |
| When to back up. Allowed values: |
| When using |
| When using |
| Do not back up files larger than this many MB. |
|
|
| For manual throttle, each thread will use up to this many Mbps. |
| Use up to this many threads (background processes) for backup. |
File Exclusion Settings
Key | Description |
|---|---|
| Exclude files with these extensions from backup. |
| Remove a file extension from the exclusion list. |
| Reset the list of excluded file extensions to defaults. |
| Exclude files from these directories from backup. |
| Remove a directory from the exclusion list. |
| Reset the list of excluded directories to defaults. |
Identity and Preferences
Key | Description |
|---|---|
| The name this computer uses when backing up. Supports |
| Allow network connectivity tests. |
| Warn if the computer has not backed up for this many days. |
| Show or hide help tips. |
| Do not display notifications to the user. |
Administrative Lock Settings
Key | Description |
|---|---|
| Prevent users from changing the backup schedule in the GUI. |
| Prevent users from changing exclusion settings in the GUI. |
| Prevent users from changing the private encryption key in the GUI. |
Network Settings
Key | Description |
|---|---|
| Add a network/MAC address pair to the network block list. Backup will not run when connected to a blocked network. |
| Remove a network/MAC address pair from the block list. |
| Clear the entire network block list. |
Note
To block a network, you must specify both the network name and the MAC address of the associated network interface. If a computer has multiple network interfaces, fully blocking a network requires a separate block list entry for each interface.
Example JSON Configuration File
Run bzcli configure --json-example to print a full sample. The following is an abbreviated example:
{
"settings": {
"online_hostname": "MyComputerName",
"backup_schedule_type": "continuously",
"num_backup_threads": 8,
"net_auto_throttle": true,
"excludefiletypes_add": [
{
"ext": "xxx"
},
{
"ext": "yyy"
}
],
"blocked_networks_add": [
{
"blocked_network_name": "CafeWifi",
"blocked_network_mac_addr": "10:c4:ca:69:66:64"
}
],
"lock_schedule": true
}
}Error Handling
Descriptive error messages are provided to help administrators diagnose and resolve issues. Common error scenarios include:
Invalid or malformed JSON configuration file
Missing or inaccessible configuration files
Insufficient permissions to modify settings
Unrecognized configuration keys (these are silently ignored)
Platform Notes
Unicode Support
Unicode is fully supported in command-line arguments. On macOS, arguments are interpreted as UTF-8. On Windows, the tool uses the wmain() entry point to accept UTF-16LE encoded arguments, which are automatically converted to UTF-8 for internal processing.
RMM Integration
bzCLI is designed for integration with enterprise RMM systems. These systems typically invoke bzcli through shell scripts to automate backup configuration across managed devices.
Platform | Supported RMM Systems |
|---|---|
macOS | Jamf, Kandji, Addigy |
Windows | Microsoft Intune |