https://github.com/infra-blue/github-repo-backup
Containerized python script that automatically backup a user's public repositories
https://github.com/infra-blue/github-repo-backup
Last synced: 4 months ago
JSON representation
Containerized python script that automatically backup a user's public repositories
- Host: GitHub
- URL: https://github.com/infra-blue/github-repo-backup
- Owner: infra-blue
- License: wtfpl
- Created: 2023-11-10T16:28:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-11T21:45:46.000Z (almost 2 years ago)
- Last Synced: 2025-02-03T02:31:18.913Z (9 months ago)
- Language: Python
- Homepage:
- Size: 30.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-repo-backup

#### Features
- Auto backup your repos easily
- A fork of [this](https://gist.github.com/Vulcalien/b631e1fe471a6baf07f1943f70434657)
## Running with Docker
#### Using Docker Compose
```yaml
version: '2'
services:
github-repo-backup:
image: ghcr.io/infra-blue/github-repo-backup:main
container_name: github-repo-backup
volumes:
- "path-to-your-settings.yaml" : /github-repo-backup/config/settings.yaml
- "path-to-your-backup-folder" : /github-repo-backup/backup
restart: unless-stopped
```
#### Building and running locally
1. Clone the repository:
```bash
$ git clone git@github.com:infra-blue/github-repo-backup.git
```
2. Make a copy of `config/settings.yaml.dist` and rename it to `config/settings.yaml`.
3. Change `user` field with your github username
4. You can even change `skip_forks` field and `auto-update-time` field (in minutes)
5. Build the image:
```bash
$ cd github-repo-backup
$ docker build -t github-repo-backup .
```
6. Run:
- On Windows:
```bash
$ docker run -v "C:\path\to\your\settings.yaml":"/github-repo-backup/config/settings.yaml" -v "C:\path-to-your-backup-folder":"/github-repo-backup/backup" github-repo-backup
```
- On Linux:
```bash
$ docker run -v "/path/to/your/settings.yaml":"/github-repo-backup/config/settings.yaml" -v "path-to-your-backup-folder":"/github-repo-backup/backup" github-repo-backup
```
### Pull image from remote repository and run
```bash
$ docker run --name github-repo-backup -v "/local/path/to/settings.yaml":"/github-repo-backup/config/settings.yaml" -v "path-to-your-backup-folder":"/github-repo-backup/backup" -t ghcr.io/infra-blue/github-repo-backup:main
```
### Running Natively
1. Clone this repository.
2. Copy `config/settings.yaml.dist` to `config/settings.yaml`.
3. Change `user` field with your github username
4. You can even change `skip_forks` field and `auto-update-time` field (in minutes)
5. Execute:
```bash
$ python main.py
```
### Credits
- [Leonardo Mirabella](https://github.com/infra-blue)
- [Vulcalien](https://github.com/Vulcalien)