Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

KontextWork/docker-github-backup

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
16 Commits
 
 
 
 
 
 

Repository files navigation

WAT

Backups the given github organization using https://github.com/josegonzalez/python-github-backupit or https://pypi.org/project/github-backup/

Features

  • wraps the python library without leaking any dependencies into the host system
  • runs as non root to ensure it runs isolated and can only write only designated folders
  • git lfs support is included

Example

All the variables

# your github organization name
export ORG=<yourorg>
# your github pat token
export TOKEN=<pat>
# the folder on your disk the backups have to be written to
export LOCAL_FOLDER=/mnt/backups/github
# --private for private repos
# --fork for forked repos
# --repositories 
export ASPECTS_TO_BACKUP=--pulls --pull-comments --pull-details --repositories  --fork --private

prepare the target folder on your host

mkdir -p $LOCAL_FOLDER
# the user inside the docker container runs under 5000:5000 and needs write permissions on the local folder
sudo chown 5000:5000 $LOCAL_FOLDER

run a backup (run once command)

# backup a single repo called yourrepo
docker run --rm -v $LOCAL_FOLDER:/home/ghbackup/backups ghcr.io/kontextwork/github-backup $ORG --organization -t $TOKEN $ASPECTS_TO_BACKUP --incremental -o /home/ghbackup/backups -R yourrepo

# backup the entire organization
docker run --rm -v $LOCAL_FOLDER:/home/ghbackup/backups ghcr.io/kontextwork/github-backup $ORG --organization -t $TOKEN $ASPECTS_TO_BACKUP --incremental -o /home/ghbackup/backups

Usage

You usually will run the one-off command to run the backup and remove the docker-container right away. You need to handle the cronjob outside the docker-image, it is not designed to run stateful.

Cloud Alternatives

This list is by no means complete or curated - just things we found. If you have any good findings, add them :)

Credits

All of those to python-github-backup

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.