Go program that utilizes the Github API to backup repos (owned and starred)
OTHER License
Go program that utilizes the Github API to backup a user's repositories, including repositories that have been starred. Multiple users can be backed up, including all members of a GitHub organization.
read:user, repo
go install
.config.example.yaml
to config.yaml
and fill in the fields.
help
command or the --help
flag for more information.config.example.yaml
file to understand the configuration options.gobackup-github backup
gobackup-github backup continuous
This program can also be run in Docker.
To create a container that removes itself after exiting, run docker run --rm -it -v ${PWD}/config.yaml:/config.yaml -v ${PWD}/backup:/backups ghcr.io/slashtechno/gobackup-github:latest
To create a container that runs on boot and performs a rolling backup every 24 hours, run docker run --restart unless-stopped -d --name gobackup-github -v ${PWD}/config.yaml:/config.yaml -v ${PWD}/backup:/backups ghcr.io/slashtechno/gobackup-github:latest continuous -i 24h
You can also just run docker compose up -d
to start the container with automatic restarts, assuming you have a docker-compose.yml
file in the same directory as the config.yaml
file. You can also edit the docker-compose.yml
file to change configuration and to manage the rolling backup, if needed.
Pull Requests are welcome!