How do I set up a cron job that automatically creates backups and uploads to my Windows PC?

I know next to nothing about Unix.

A couple months ago I set up a private GitLab server on an old netbook I had lying around. It has an x86 CPU, so I had to install from source, and that took about 3 days to figure out (again, I’m a Unix Luddite). Since getting everything up and running, I’ve been meaning to figure out a backup scheme, but I keep putting it off due to my lack of Unix understanding.

I’d like to set up an automated weekly backup that uploads to my Windows machine. From the research I’ve done, it sounds like I want a “cron job.” I have a general understanding of what that is, but I have no idea how to set up what I’m looking for.

After figuring out what I need, I did some more research. I found this bit of documentation on backup creation, and it even includes a little information on how to set up a cron job. This looks great, but I’m running in to a couple of problems:

  • The documentation says it’ll do it daily, but I’d prefer weekly. If daily is easier, this isn’t a big deal.
  • I can’t find where the backup files get created.
  • It sounds like my gitlab.yml or SSH host keys (I remember the gitlab.yml from setting up, and I think the SSH host keys are for the git via ssh functionality (I only use HTTP at the moment, still learning)) don’t get backed up, and I think I’ll need these backed up.
  • This only backs up to the server, not to a remote device. There is some information about backing up to remotes, but it sounds like these are only to various 3rd party services like AWS.

If it’s not too much to ask, it’d be great if someone could modify the cron job in the documentation to do what I need it to. If it’s really complicated, then I think if I just knew where the backups get stored and what to search for to figure out how to upload to a Windows computer, I could claw my way through the rest.


Okay, I had a bit more time to research, and looks like I can change the third star to “6” to do backups every Saturday at 4 AM:

0 4 * * 6 cd /home/git/gitlab && PATH=/usr/local/bin:/usr/bin:/bin bundle exec rake gitlab:backup:create RAILS_ENV=production CRON=1

Now my next problem is figuring out how to automatically upload those backups to my Windows PC. I’ll do more research later today and report back. Already finding some interesting information.