Skip to content

Instantly share code, notes, and snippets.

View spanthetree's full-sized avatar

David Woodruff spanthetree

View GitHub Profile
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"/media/github_backup/bash_backup"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"YOUR_ORG"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"YOUR_USERNAME"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"YOUR_PASSWORD"} # the password for that account
GHBU_GITHOST=${GHBU_GITHOST-"github.com"} # the GitHub hostname (see comments)
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted