{"id":13498206,"url":"https://github.com/sund/auto-gitlab-backup","last_synced_at":"2025-03-28T23:30:46.424Z","repository":{"id":8778580,"uuid":"10466270","full_name":"sund/auto-gitlab-backup","owner":"sund","description":"A simple script to backup your Gitlab data. This script will copy the backup archives of your gitlab installation via rsync, or scp. Also, you can copy backups to Backblaze’s B2 Cloud Storage service.","archived":false,"fork":false,"pushed_at":"2021-11-19T14:10:06.000Z","size":815,"stargazers_count":314,"open_issues_count":4,"forks_count":73,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-08-01T20:38:25.269Z","etag":null,"topics":["auto-gitlab-backup","backup","backup-archive","backup-script","gitlab-installation","rsync","shell"],"latest_commit_sha":null,"homepage":"http://sund.github.io/auto-gitlab-backup/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sund.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-03T22:36:36.000Z","updated_at":"2024-07-28T18:51:41.000Z","dependencies_parsed_at":"2022-09-17T10:11:26.509Z","dependency_job_id":null,"html_url":"https://github.com/sund/auto-gitlab-backup","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sund%2Fauto-gitlab-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sund%2Fauto-gitlab-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sund%2Fauto-gitlab-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sund%2Fauto-gitlab-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sund","download_url":"https://codeload.github.com/sund/auto-gitlab-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222426448,"owners_count":16982685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auto-gitlab-backup","backup","backup-archive","backup-script","gitlab-installation","rsync","shell"],"created_at":"2024-07-31T20:00:53.994Z","updated_at":"2024-10-31T14:31:36.314Z","avatar_url":"https://github.com/sund.png","language":"Shell","readme":"# Auto GitLab Backup\n\n[![AGB Logo](https://raw.githubusercontent.com/sund/auto-gitlab-backup/develop/agb_logo.png)](http://sund.la/glup)\n\n----\n\n## Synopsis\n\nA simple script to backup your Gitlab data. This script will copy the backup archives of your gitlab installation via rsync, or scp. Also, you can copy backups to [Backblaze’s B2 Cloud Storage service.](https://www.backblaze.com/b2/cloud-storage.html) There is also a restore script available (see below.)\n\nIt can backup and copy the ```gitlab.rb``` config file, if configured.\n\nThis script is now more omnibus-gitlab centric. Compare your config file with the template! Usage with a source install is possible but not expressly shown here.\n\n## Installation\n\n### Prerequisites\n\nDeploy a working GitLab Omnibus installation and verify you can back it up with the rake task as documented in the [GitLab Documents](http://doc.gitlab.com/ce/raketasks/backup_restore.html).\n\nFor Backblaze usage, configure your system for the [Backblaze Command-Line Tool](https://www.backblaze.com/b2/docs/quick_command_line.html) Also, see the [wiki page on B2](https://github.com/sund/auto-gitlab-backup/wiki/Backblaze-B2-Command-Line-Tool).\n\n#### Set up gitlab to expire backups\n\nChange ```/etc/gitlab/gitlab.rb``` to expire backups\n\n```\n# backup keep time\ngitlab_rails['backup_keep_time'] = 604800\n```\n\n### Installation\n\nClone to your directory of choice. I usually use ```/usr/local/sbin```\n\n```\ngit clone git@github.com:sund/auto-gitlab-backup.git\n```\n\n### Updates\n\nCompare the ```auto-gitlab-backup.conf.sample``` file with your own copy. Make changes as needed to ensure no errors are encountered.\n\n### Configure\n\n```bash\ncp auto-gitlab-backup.conf.sample auto-gitlab-backup.conf\n```\n\nedit ```auto-gitlab-backup.conf```\n\n```bash\n## user account on remote server\n#  likely 'git' user\nremoteUser=\"\"\n\n## remote host\n#  a backup gitlab server?\nremoteServer=\"\"\n\n## path to an alternate ssh key, if needed.\nsshKeyPath=\"\"\n\n## $remoteServer path for gitlab backups\nremoteDest=\"/var/opt/gitlab/backups\"\n\n## backup gitlab configs\n# change to 1 to enable\nbackupConfigs=“0”\n\n## rake quietly\n# change to 1 to enable quiet rake job\nquietRake=0\n\n## enable backblaze b2 sync\n# change to 1 to enable\n# and set bucket name\n# and change b2keepDays if other than 5 days is desired\nb2blaze=0\nb2Bucketname=“”\nb2keepDays=“5”\n\n## set $localConfDir\n# blank disables conf backups\n# you can create /var/opt/gitlab/backups/configBackups --\n# gitlab doesn't seem to complain with a subfolder\n# in there. Plus it will rsync up with the backup.\n# So you won't need to enable a separate rsync run\nlocalConfDir=\"/var/opt/gitlab/backups/configBackups\"\n\n## set $remoteServer path for gitlab configs\n# blank disables remote copy\n# unless $localConfDir is outside /var/opt/gitlab/backups/configBackups\n# you can leave this blank\nremoteConfDest=\"\"\n\n## ssh port or 873 for rsyncd port\nremotePort=22\n\n## git user home.\n#  Only change the below setting if you have git's home in a different location\ngitHome=\"/var/opt/gitlab\"\n\n## only set below if rvm is in use and you need to source the rvm env file\n# echo $(rvm env --path)\nRVM_envPath=\"\"\n\n## only use the below settings if your destination is using rsync in daemon mode\nremoteModule=\"\"\nrsync_password_file=\"\"\n\n## only change if configs are in different locations. (unlikely)\nlocalConfig=\"/etc/gitlab\"\nlocalsshkeys=\"/var/opt/gitlab/.ssh\"\n\n## Check remote quota\n#  change to true or 1 to enable\ncheckQuota=\"0\"\n\n```\n\n### cron settings\n\nExample for crontab to run at 5:05am everyday.\n\n```bash\n5 5 * * * /usr/local/sbin/auto-gitlab-backup/auto-gitlab-backup.sh\n```\n\n## Restore\n\n*Still under development but useful*\n\nrun ```./restoreGitLab.sh -r``` and it will attempt to restore a backup. You may have to run some rake commands manually.\n\n## Help\n\nSee the [Wiki](https://github.com/sund/auto-gitlab-backup/wiki) for more detailed instructions or submit a [Issue](https://github.com/sund/auto-gitlab-backup/issues).\n\n## Contribute\n\nSee [Contribution Guide](https://github.com/sund/auto-gitlab-backup/blob/master/CONTRIBUTING.md) to improve this script.","funding_links":[],"categories":["Shell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsund%2Fauto-gitlab-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsund%2Fauto-gitlab-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsund%2Fauto-gitlab-backup/lists"}