Code Monkey home page Code Monkey logo

github-to-b2's Introduction

GitHub to Backblaze B2

Script to backup GitHub repo(s) to Backblaze B2.

This is the process:

  • Download the specified repo to a temporary directory.
  • Compress the repo using tar/gzip
  • Upload the compressed archive.
  • Delete the archive and repo from the temp dir.
  • Repeat above steps for any additional specified repos.
  • Delete the temp dir itself (if empty).

Story

I wanted to apply safer shell practices to this gist which was featured in this blog entry by Backblaze. Work started as a fork of the gist here but I wanted to support backing up multiple repositories at a time. So I decided to make a full project so I could use features from the BASH3 Boilerplate.

Changes / Improvements

  • All variables can be passed as arguments.
  • All variables are quoted for safety.
  • Exit on any error, not just the specified tests.
  • Clone the GitHub repo(s) using either HTTPS or SSH.
  • Support backing up multiple repos.
  • Authorize the B2 command line tool instead of relying on the user doing so manually.
  • Recognize the B2 command line tool from the Arch Linux user repository.
    • (It's named backblaze-b2 instead of b2 see PKGBUILD for details)
  • Removed optional file encryption section from source gist.
    • It wouldn't work as expected as it would encrypt the repo but then upload the non-encrypted copy instead.
    • If encryption was going to be used, I would not recommend using a symmetric cipher.

Credit

Nilay Patel, for git-backup-to-Backblaze-B2.sh which this script is based on. https://gist.github.com/nilayp/a2719ca5695c1d5a56c556e89207577d

github-to-b2's People

Contributors

2shirt avatar

Stargazers

Gil avatar

Watchers

James Cloos avatar Gil 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.