Table of Contents

Gitlab

Path:

/var/opt/gitlab
/var/opt/gitlab/backups

Commands

gitlab-rake gitlab:check SANITIZE=true                               #GitLab application check
gitlab-rails console                                                 #
gitlab-ctl show-config
gitlab-ctl reconfigure

Backup

backup_git.sh
#!/bin/bash
 
#author:  Thomas Roehm
#version: 1.1
 
#set container-ID of your gitlab
CONTAINERID="e039f53d298a"
 
docker exec -t ${CONTAINERID} gitlab-backup create
 
echo ""
echo "backup secrets..."
echo ""
docker exec -t ${CONTAINERID} cp -a /etc/gitlab/gitlab-secrets.json /var/opt/gitlab/backups/.
docker exec -t ${CONTAINERID} cp -a /etc/gitlab/gitlab.rb /var/opt/gitlab/backups/.
echo ""
echo "backup secrets done"
echo ""

Restore

restore_git.sh
#!/bin/bash
 
#author:  Thomas Roehm
#version: 1.1
 
#set container-ID of your gitlab
CONTAINERID="e039f53d298a"
 
docker exec -it ${CONTAINERID} gitlab-backup restore --trace
 
read -p "Please enter the version you  want to restore (e. g. \"1586806592_2020_04_13_12.4.2\"): " ID
echo "ID: \"${ID}\" will be restored!"
 
echo ""
docker exec -it ${CONTAINERID} gitlab-backup restore BACKUP=${ID}
echo""
echo "ID \"${ID}\" has been restored"
linux/gitlab.txt · Last modified: 2020/07/07 09:59 by tmade
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki