Giter Site home page Giter Site logo

taskulu / b2_command_line_tool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from backblaze/b2_command_line_tool

0.0 4.0 0.0 1.08 MB

The command-line tool that gives easy access to all of the capabilities of B2 Cloud Storage

License: Other

Python 96.44% PowerShell 1.76% Batchfile 0.82% Shell 0.98%

b2_command_line_tool's Introduction

B2 Command Line Tool

Status
Travis CI
License
![python versions](https://img.shields.io/pypi/pyversions/b2.svg?label=python versions)
![PyPI version](https://img.shields.io/pypi/v/b2.svg?label=PyPI version)

The command-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.

Version 0.7.3

Installation

This tool can be installed with:

pip install b2

If you see a message saying that the six library cannot be installed, which happens if you're installing with the system python on OS X El Capitan, try this:

pip install --ignore-installed b2

Usage

b2 authorize-account [<accountId>] [<applicationKey>]
b2 cancel-all-unfinished-large-files <bucketName>
b2 cancel-large-file <fileId>
b2 clear-account
b2 create-bucket [--bucketInfo <json>] [--lifecycleRules <json>] <bucketName> [allPublic | allPrivate]
b2 delete-bucket <bucketName>
b2 delete-file-version [<fileName>] <fileId>
b2 download-file-by-id [--noProgress] <fileId> <localFileName>
b2 download-file-by-name [--noProgress] <bucketName> <fileName> <localFileName>
b2 get-account-info
b2 get-bucket <bucketName>
b2 get-download-auth [--prefix <fileNamePrefix>] [--duration <durationInSeconds>] <bucketName>
b2 get-file-info <fileId>
b2 help [commandName]
b2 hide-file <bucketName> <fileName>
b2 list-buckets
b2 list-file-names <bucketName> [<startFileName>] [<maxToShow>]
b2 list-file-versions <bucketName> [<startFileName>] [<startFileId>] [<maxToShow>]
b2 list-parts <largeFileId>
b2 list-unfinished-large-files <bucketName>
b2 ls [--long] [--versions] <bucketName> [<folderName>]
b2 make-url <fileId>
b2 sync [--delete] [--keepDays N] [--skipNewer] [--replaceNewer] \
    [--compareVersions <option>] [--threads N] [--noProgress] \
    [--excludeRegex <regex> [--includeRegex <regex>]] [--dryRun] \
    <source> <destination>
b2 update-bucket [--bucketInfo <json>] [--lifecycleRules <json>] <bucketName> [allPublic | allPrivate]
b2 upload-file [--sha1 <sha1sum>] [--contentType <contentType>] \
    [--info <key>=<value>]* [--minPartSize N] \
    [--noProgress] [--threads N] <bucketName> <localFilePath> <b2FileName>
b2 version

For more details on one command: b2 help <command>

Parallelism and the --threads parameter

Users with high performance networks, or file sets with very small files, may benefit from increased parallelism. Experiment with using the --threads parameter with small values to determine if there are benefits.

Note that using multiple threads will usually be detrimental to the other users on your network.

Contrib

bash completion

You can find a bash completion script in the contrib directory. See this for installation instructions.

detailed logs

A hidden flag --debugLogs can be used to enable logging to a b2_cli.log file (with log rotation at midnight) in current working directory. Please take care to not launch the tool from the directory that you are syncing, or the logs will get synced to the remote server (unless that is really what you want to do).

For advanced users, a hidden option --logConfig <filename.ini> can be used to enable logging in a user-defined format and verbosity. An example log configuration can be found here.

Developer Info

We encourage outside contributors to perform changes on our codebase. Many such changes have been merged already. In order to make it easier to contribute, core developers of this project:

  • provide guidance (through the issue reporting system)
  • provide tool assisted code review (through the Pull Request system)
  • maintain a set of integration tests (run with a production cloud)
  • maintain a set of (well over a hundred) unit tests
  • automatically run unit tests on 14 versions of python (including osx, Jython and pypy)
  • format the code automatically using yapf
  • use static code analysis to find subtle/potential issues with maintainability
  • maintain other Continous Integration tools (coverage tracker)

You'll need to have these packages installed:

  • nose
  • pyflakes
  • six
  • yapf

There is a Makefile with a rule to run the unit tests using the currently active Python:

make test

To test in multiple python virtual environments, set the enviroment variable PYTHON_VIRTUAL_ENVS to be a space-separated list of their root directories. When set, the makefile will run the unit tests in each of the environments.

Before checking in, use the pre-commit.sh script to check code formatting, run unit tests, run integration tests etc.

The integration tests need a file in your home directory called .b2_auth that contains two lines with nothing on them but your account ID and application key:

 accountId
 applicationKey

We marked the places in the code which are significantly less intuitive than others in a special way. To find them occurrences, use git grep '*magic*'.

b2_command_line_tool's People

Contributors

andy4blaze avatar bwbeach avatar cederberg avatar ferricoxide avatar florenthemmi avatar gdhgdhgdh avatar henrikbengtsson avatar magnetikonline avatar mapio avatar neube3 avatar nilayp avatar papafox avatar peff avatar ppolewicz avatar segphault avatar szepeviktor avatar tenzer avatar tjc avatar zackse avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.