Note
Event Notifications feature is now in Private Preview. See https://www.backblaze.com/blog/announcing-event-notifications/ for details.
Overview
This program provides command-line access to the B2 service.
There are two flows of authorization:
call
b2 authorize-account
and have the credentials cached in sqliteset
B2_APPLICATION_KEY_ID
andB2_APPLICATION_KEY
environment variables when running this program
This program caches authentication-related and other data in a local SQLite database. The location of this database is determined in the following way:
If --profile
arg is provided:
XDG_CONFIG_HOME/b2/db-<profile>.sqlite
, ifXDG_CONFIG_HOME
env var is set~/.b2db-{profile}.sqlite
Otherwise:
B2_ACCOUNT_INFO
env var’s value, if set~/.b2_account_info
, if it existsXDG_CONFIG_HOME/b2/account_info
, ifXDG_CONFIG_HOME
env var is set~/.b2_account_info
, as default
If the directory XDG_CONFIG_HOME/b2
does not exist (and is needed), it is created.
Please note that the above rules may be changed in next versions of b2sdk, and in order to get
reliable authentication file location you should use b2 get-account-info
.
Control characters escaping is turned on if running under terminal. You can override it by explicitly using –escape-control-chars/–no-escape-control-chars` option, or by setting B2_ESCAPE_CONTROL_CHARACTERS environment variable to either 1 or 0.
You can suppress command stdout & stderr output by using --quiet
option.
To supress only progress bar, use --no-progress
option.
For more details on one command:
b2 <command> --help
When authorizing with application keys, this tool requires that the key
have the listBuckets
capability so that it can take the bucket names
you provide on the command line and translate them into bucket IDs for the
B2 Storage service. Each different command may required additional
capabilities. You can find the details for each command in the help for
that command.
A string provided via an optional environment variable B2_USER_AGENT_APPEND
will be appended to the User-Agent.
Documentation index
- Quick Start Guide
- Commands
- Authorize-account command
- Cancel-all-unfinished-large-files command
- Cancel-large-file command
- Cat command
- Clear-account command
- Copy-file-by-id command
- Create-bucket command
- Create-key command
- Delete-bucket command
- Delete-file-version command
- Delete-key command
- Download-file command
- Download-file-by-id command
- Download-file-by-name command
- File-info command
- Get-account-info command
- Get-bucket command
- Get-download-auth command
- Get-download-url-with-auth command
- Get-file-info command
- Get-url command
- Hide-file command
- install-autocomplete command
- List-buckets command
- List-keys command
- List-parts command
- List-unfinished-large-files command
- Ls command
- Make-friendly-url command
- Make-url command
- replication-setup command
- Rm command
- Sync command
- Update-bucket command
- Update-file-legal-hold command
- Update-file-retention command
- Upload-file command
- Version command
- Replication