https://github.com/d-oit/synology-github-backup
Synology NAS backup script for multiple GitHub accounts — auto-detects login as subfolder, paginates all repos
https://github.com/d-oit/synology-github-backup
Last synced: 21 days ago
JSON representation
Synology NAS backup script for multiple GitHub accounts — auto-detects login as subfolder, paginates all repos
- Host: GitHub
- URL: https://github.com/d-oit/synology-github-backup
- Owner: d-oit
- Created: 2026-04-20T18:08:07.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-04-20T18:48:59.000Z (2 months ago)
- Last Synced: 2026-04-20T20:24:44.732Z (2 months ago)
- Language: Shell
- Size: 21.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# synology-github-backup
Synology NAS shell script that backs up all owned GitHub repositories as ZIP snapshots.
Supports multiple accounts — the script auto-detects the authenticated login from each PAT
and uses it as the subfolder name.
## Output structure
```
/volume1/homes/Dominik/sourcecode/github/
d-1/
repo-a.zip
repo-b.zip
d-2/
repo-x.zip
```
## Requirements
| Tool | Install |
|------|---------|
| `curl` | Built into DSM |
| `jq` | SynoCommunity or Entware |
| `mktemp` | Built into DSM |
## Setup
1. Copy `github_backup.sh` to `/volume1/homes/Dominik/sourcecode/github_backup.sh`
2. `chmod +x /volume1/homes/Dominik/sourcecode/github_backup.sh`
3. Create `/volume1/homes/Dominik/sourcecode/github_tokens.txt` from `github_tokens.txt.example`
4. Add to **DSM → Control Panel → Task Scheduler → Create → Scheduled Task → User-defined script**
- User: `Dominik` (or a dedicated backup user)
- Schedule: Daily
- Run command: `/volume1/homes/Dominik/sourcecode/github_backup.sh`
## Fine-grained PAT permissions needed
- **Metadata**: Read-only (required for listing repos)
- **Contents**: Read-only (required for downloading zipballs)
## Notes
- Downloads **ZIP snapshots only** — no Git history.
- For a full disaster-recovery backup use `git clone --mirror` instead.
- Each run overwrites the previous ZIP for the same repo.
- Pagination is handled automatically (100 repos per page).