https://github.com/koraa/github-mirror.sh
Simple shell script that automatically mirrors github user's public repositories.
https://github.com/koraa/github-mirror.sh
Last synced: about 2 months ago
JSON representation
Simple shell script that automatically mirrors github user's public repositories.
- Host: GitHub
- URL: https://github.com/koraa/github-mirror.sh
- Owner: koraa
- License: other
- Created: 2015-02-21T13:06:39.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-21T14:19:40.000Z (about 10 years ago)
- Last Synced: 2025-01-30T18:22:51.438Z (4 months ago)
- Language: Shell
- Size: 125 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.CC-0
Awesome Lists containing this project
README
# Github Mirror
Github mirror is a short shell script that allows automatic
mirroring of all repos by a github user.Experienced shell programmers might find the ls_users
subcommand and the mirror_one_repo useful for more complex
use cases.## USAGE
```shell
$ github-mirror.sh mirror [USER]...
```
and as a practical example, this is what I use:```shell
$ github-mirror.sh mirror koraa inexor-game premium-cola Shoctode soup
```You can also back up the wikis too:
```shell
$ show_wiki=true github-mirror.sh mirror koraa inexor-game premium-cola Shoctode soup
```Take care to start it in the right directory, because it
always operates on relative paths. You can use braces, to
change directory in a sub shell, so the next time you see
your prompt you will still be in the same directory:```shell
$ (cd ~karo/git-infra/github-mirror/; github-mirror.sh mirror koraa inexor-game premium-cola Shoctode soup)
```you should put it into your crontab file: Use `crontab -e`,
to open your crontab file, and then add your config, I am
using this:```shell
@hourly cd ~karo/git-infra/github-mirror/; ~karo/git-infra/github-mirror.git/github-mirror.sh mirror koraa inexor-game premium-cola Shoctode soup
```If you need to filter the repositories you want to mirror
you can user mirror_one_repo and ls_repos to do that:```shell
$ cd ~karo/git-infra/github-mirror/
$ github-mirror.sh ls_repos soup inexor-game karo \
| grep "/awesome-.*" \
| xargs -l1 -t github-mirror.sh mirror_one_repo
```## Future directions
The safety and error handling in this script are pretty weak
at the moment. We should provide clearly visible error
messages at the end of the output and we should add the
option to disable informative output to stderr.
This script should also use defined exit codes.If someone requests it, I am going to add the possibility to
filter repos by regex.## License
Copyright 2015 by Karolin Varner.
This is licensed under CC-0, but you can still buy me
a drink if you meet me.