Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
I will show how to do a backup of your GitHub repositories with python-github-backup
Why to bother with a backup of GitHub
I can already see that there will be comments regarding why to do the backup of GitHub.
- âIt is a waste of time.â
- âGitHub internally already have backups.â (I hope so)
- âThey will not lose your codeâ (But maybe IÂ will)
- âThey will not go overnight out of business.â
Response to all those comments is:You will not be worst off if you have your own backup.
If forever reason (GitHub go under, all repositories deleted by accident, alien attack) GitHub is not available anymore, I have my own backup of code that I have written.
Paid solution
If you are looking for a paid solution, BackHub looks like a good solution. I have no experience with BackHub, nor am I in any way associated with it.
Free solution
After researching all available options I have decided to go with python-github-backup because it had more stars and contributors on GitHub than other projects.
I have used the number of stars and contributors on GitHub as the assumption that python-github-backup is more in use than other solutions so there are more people who will continue to support it in future.
In order to access your GitHub personal data, you need to have a personal access token.
After that, you can install it with pip/pipenv: (I have installed it in separate virtualenv)
pipenv install github-backup or
pip install github-backup
Run it with: /full/path/github_backup/venv/bin/github-backup sasa-buklijas -t your_personal_access_token -o /full/path/github_backup --all
This command will backup all your GitHub information to /full/path/github_backup directory.
It would be tiresome to run this command every day, so I have automated it on my online hosting.
Crontab
My usecase: 15 00 * * * /full/path/github_backup/venv/bin/github-backup sasa-buklijas -t your_personal_access_token -o /full/path/github_backup --all > /full/path/github_backup/last_log.txt
> /full/path/github_backup/last_log.txt is used to have an output of the last backup command. >> can be used to have outputs of all backup commands, but I have found that having just last one is enough.
Conclusion
âYou will not be worse off if you have your own backup.â
Do you have backups of your own personal GitHub repositories, if you have, what do you use for backup?
Originally published at buklijas.info on August 1, 2018.
How to backup personal GitHub repositories was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.