Running gickup on a QNAP NAS
15 Oct 2022 in Tech
I learned about Gickup whilst reading Jeff Geerling’s backup plan and thought it would be a useful thing to run for my own repos.
I initially ran it on my local machine periodically, then realised that I could run it on my QNAP NAS every night. Here’s how I did it:
- Create a shared folder named
gickupto contain the backups. I’ve got a volume namedBackupsthat contains this, but any volume will do - Create a directory to store your backups by running
mkdir -p /share/gickup/repos - Edit
/etc/config/crontaband add the following line to the end:0 3 * * * docker run --rm -v /share/gickup:/hostvol buddyspencer/gickup:0.9 /gickup/app /hostvol/config.yml > /share/gickup/last-run.log 2>&1. This will rungickupevery day at 3am - Reload cron to pick up that change by running
crontab /etc/config/crontab && /etc/init.d/crond.sh restart
You may have noticed that I reference /hostvol/config.yml. I mount the /share/gickup folder a /hostvol, and config.yml is my gickup configuration file. Here’s what it looks like:
yaml# config.yml in /share/gickupsource:github:- token: CHANGE_ME_TO_YOUR_GITHUB_PATexcludeorgs: # this excludes repos from the organizations "foo" and "bar"- foo- bardestination:local:- path: /hostvol/reposstructured: true
Create your own config.yml, making sure you change the token value. If you’ve configured all of the above, all the repositories you have access to will be backed up at 3am each day.