Skip to main content

github backup

Project description

File        : README.md
Maintainer  : Felix C. Stegerman <flx@obfusk.net>
Date        : 2020-06-22

Copyright   : Copyright (C) 2020  Felix C. Stegerman
Version     : v0.1.5
License     : GPLv3+

PyPI Version CI GPLv3+

Description

ghbak - github backup

Mirror (or update) github repos (and issues) and/or gists to:

{basedir}/
  {github_username}/
    github/
      {repo_name}.git
      {repo_name}-issues.json
      ...
    gist/
      {gist_id}.git
      ...

The base directory defaults to ./{YYYYMMDD} (the current date).

Examples

$ export GITHUB_TOKEN=your-github-token
$ ghbak --repos --gists --ssh --verbose your-github-username
user: your-github-username
token $GITHUB_TOKEN
GET https://api.github.com/users/your-github-username/repos
...
GET https://api.github.com/users/your-github-username/gists
...
cloning 42 repos...
==> repo your-github-username/your-repo | description
$ cd 20200101/your-github-username/github
$ git clone --mirror -n git@github.com:your-github-username/your-repo.git your-repo.git
...
cloning 37 gists...
==> gist your-github-username | gist-id | description
$ cd 20200101/your-github-username/gist
$ git clone --mirror -n git@gist.github.com:gist-id.git gist-id.git
...

=== summary ===

backed up repos: 42
backed up gists: 37

Help

$ ghbak --help

Requirements

Python >= 3.5 + click + requests.

Installing

Using pip

$ pip install ghbak

Manually

Install the dependencies (as e.g. debian packages or using pip):

$ apt install python3-click python3-requests  # debian/ubuntu
$ pip install click requests                  # pip

Then just put ghbak somewhere on your $PATH (e.g. ~/bin).

License

GPLv3+

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghbak-0.1.5.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

ghbak-0.1.5-py3-none-any.whl (17.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page