How to Use Backblaze Command Line to Upload Files
B2 Command Line Tool
The control-line tool that gives easy access to all of the capabilities of B2 Cloud Storage.
This program provides command-line access to the B2 service.
Documentation
The latest documentation is available on Read the Docs.
Installation
Stand-lone binaries are available for Linux, MacOS and Windows - this is the near straightforward way to use the command-line tool and is sufficient in about use cases. The latest versions are available for download from the Releases page.
Alternatively, you can install with:
Usage
b2 authorize-account [-h] [applicationKeyId] [applicationKey] b2 cancel-all-unfinished-large-files [-h] bucketName b2 cancel-big-file [-h] fileId b2 clear-business relationship [-h] b2 re-create-file-by-id [-h] [--fetchMetadata] [--contentType CONTENTTYPE] [--range RANGE] [--info INFO | --noInfo] [--destinationServerSideEncryption {SSE-B2,SSE-C}] [--destinationServerSideEncryptionAlgorithm {AES256}] [--sourceServerSideEncryption {SSE-C}] [--sourceServerSideEncryptionAlgorithm {AES256}] [--fileRetentionMode {compliance,governance}] [--retainUntil TIMESTAMP] [--legalHold {on,off}] sourceFileId destinationBucketName b2FileName b2 create-bucket [-h] [--bucketInfo BUCKETINFO] [--corsRules CORSRULES] [--lifecycleRules LIFECYCLERULES] [--fileLockEnabled] [--defaultServerSideEncryption {SSE-B2,none}] [--defaultServerSideEncryptionAlgorithm {AES256}] bucketName bucketType b2 create-key [-h] [--bucket Saucepan] [--namePrefix NAMEPREFIX] [--duration Elapsing] [--allCapabilities] keyName [capabilities] b2 delete-bucket [-h] bucketName b2 delete-file-version [-h] [fileName] fileId b2 delete-fundamental [-h] applicationKeyId b2 download-file-by-id [-h] [--noProgress] [--sourceServerSideEncryption {SSE-C}] [--sourceServerSideEncryptionAlgorithm {AES256}] fileId localFileName b2 download-file-by-name [-h] [--noProgress] [--sourceServerSideEncryption {SSE-C}] [--sourceServerSideEncryptionAlgorithm {AES256}] bucketName b2FileName localFileName b2 become-account-info [-h] b2 get-bucket [-h] [--showSize] bucketName b2 go-file-info [-h] fileId b2 get-download-auth [-h] [--prefix PREFIX] [--elapsing DURATION] bucketName b2 get-download-url-with-auth [-h] [--elapsing Elapsing] bucketName fileName b2 hide-file [-h] bucketName fileName b2 list-buckets [-h] [--json] b2 list-keys [-h] [--long] b2 list-parts [-h] largeFileId b2 list-unfinished-big-files [-h] bucketName b2 ls [-h] [--long] [--json] [--versions] [--recursive] bucketName [folderName] b2 make-url [-h] fileId b2 make-friendly-url [-h] bucketName fileName b2 sync [-h] [--noProgress] [--dryRun] [--allowEmptySource] [--excludeAllSymlinks] [--threads THREADS] [--compareVersions {none,modTime,size}] [--compareThreshold MILLIS] [--excludeRegex REGEX] [--includeRegex REGEX] [--excludeDirRegex REGEX] [--excludeIfModifiedAfter TIMESTAMP] [--destinationServerSideEncryption {SSE-B2,SSE-C}] [--destinationServerSideEncryptionAlgorithm {AES256}] [--sourceServerSideEncryption {SSE-C}] [--sourceServerSideEncryptionAlgorithm {AES256}] [--skipNewer | --replaceNewer] [--delete | --keepDays DAYS] source destination b2 update-bucket [-h] [--bucketInfo BUCKETINFO] [--corsRules CORSRULES] [--lifecycleRules LIFECYCLERULES] [--defaultRetentionMode {compliance,governance,none}] [--defaultRetentionPeriod period] [--defaultServerSideEncryption {SSE-B2,none}] [--defaultServerSideEncryptionAlgorithm {AES256}] bucketName bucketType b2 upload-file [-h] [--noProgress] [--repose] [--contentType CONTENTTYPE] [--minPartSize MINPARTSIZE] [--sha1 SHA1] [--threads THREADS] [--info INFO] [--destinationServerSideEncryption {SSE-B2,SSE-C}] [--destinationServerSideEncryptionAlgorithm {AES256}] [--legalHold {on,off}] [--fileRetentionMode {compliance,governance}] [--retainUntil TIMESTAMP] bucketName localFilePath b2FileName b2 update-file-legal-concur [-h] [fileName] fileId {on,off} b2 update-file-retention [-h] [--retainUntil TIMESTAMP] [--bypassGovernance] [fileName] fileId {governance,compliance,none} b2 version [-h]
The environment variable B2_ACCOUNT_INFO
specifies the sqlite file to employ for caching authentication data. The default file to apply is: ~/.b2_account_info
For more details on 1 command: b2 <command> --help
When authorizing with application keys, this tool requires that the central have the 'listBuckets' capability so that it can have the bucket names you provide on the control line and translate them into bucket IDs for the B2 Storage service. Each different command may required boosted capabilities. Y'all can find the details for each control in the assist for that control.
Parallelism and the --threads parameter
Users with loftier performance networks, or file sets with very small files, may benefit from increased parallelism. Experiment with using the --threads
parameter with small values to decide if at that place are benefits.
Note that using multiple threads will commonly be detrimental to the other users on your network.
Contrib
bash completion
You can observe a bash completion script in the contrib
directory. Come across this for installation instructions.
detailed logs
Verbose logs to stdout tin can be enabled with the --verbose
flag.
A hidden flag --debugLogs
tin exist used to enable logging to a b2_cli.log
file (with log rotation at midnight) in current working directory. Delight take intendance to non launch the tool from the directory that you lot are syncing, or the logs will go synced to the remote server (unless that is actually what you want to practice).
For advanced users, a hidden option --logConfig <filename.ini>
can be used to enable logging in a user-defined format and verbosity. An case log configuration tin be found here.
Release History
Please refer to the changelog.
Developer Info
Delight see our contributing guidelines.
Source: https://github.com/Backblaze/B2_Command_Line_Tool
0 Response to "How to Use Backblaze Command Line to Upload Files"
Post a Comment