Backup Script for Codebase Git Repositories
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
Makefile
README.md
codebase_backup.php
composer.json
config.php.template

README.md

Codebase Repository Backup

Codebase is “Git, Mercurial and Subversion hosting with project management tools”. It's used for hosting software projects, like Github or Gitlab.

Codebase provides an API which is leveraged by this tool for exploring all of an account's repositories and backup them to a local folder.

Requirements

  • Codebase account
  • PHP ≥5.6

Installation and Setup

  • clone the backup script repository: git clone git@github.com:mjaschen/codebase-backup.git
  • change into the newly created directory: cd codebase-backup
  • run composer install --no-dev
  • create config file
  • run the backup script

Installation in one line

git clone git@github.com:mjaschen/codebase-backup.git && cd codebase-backup && composer install --no-dev

Setup

Create a config file: cp config.php.template config.php

Add config options in config.php:

  • CODEBASE_USER your Codebse username, e. g. 'foobarinc/mjaschen', see "Settings > My Profile"
  • CODEBASE_TOKEN Codebase API token, see "Settings > My Profile"
  • BACKUP_DIR a backup target directory, e. g. /Volumes/Backup/Codebase
  • GIT_BIN path to Git executable; optional

Run the backup script

make backup

or

php codebase_backup.php

References