https://github.com/janst123/github-backup
simple script to backup all your github repositories
https://github.com/janst123/github-backup
cron github-backup github-backups netcup php shell webhosting
Last synced: 2 months ago
JSON representation
simple script to backup all your github repositories
- Host: GitHub
- URL: https://github.com/janst123/github-backup
- Owner: JanST123
- Created: 2023-12-15T10:49:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-15T10:49:54.000Z (over 1 year ago)
- Last Synced: 2025-01-03T16:53:17.125Z (4 months ago)
- Topics: cron, github-backup, github-backups, netcup, php, shell, webhosting
- Language: Shell
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple github backup script
This backup script back ups your personal github repositories via git+ssh including also the private repositories.
It uses a combination of a shell script and a PHP script. PHP is used as I only have a very basic set of shell commands available at my webhoster "Netcup". So this script also works on cheap webhosting packages.## Requirements
* curl
* git
* PHP (5.x should be enough)
* tar
* gzip## Usage
* Create a **personal access token** in your GitHub `Settings->Developer Settings` with `read:packages` scope
* Run the script via cronjob like so: `GITHUB_AUTH_TOKEN= cd github_backup && ./backup.sh > log.log 2>&1`## Result
The script will mirror all your repositories to a local temporary directory and finally tgz it.**Attention** the script contains a line to remove all existing `.tgz` files first, as I only wanted one backup. As the filename contains the date you could remove this line and have one backup per day. But you will want to implement a cleanup as each backup contains a full copy of all repos.