gitlab备忘
2017-08-15 本文已影响2人
menglj
使用docker镜像启动gitlab
sudo docker run --detach \
--hostname gitlab.example.com \
--publish 443:443 --publish 80:80 --publish 22:22 \
--name gitlab \
--restart always \
--volume /srv/gitlab/config:/etc/gitlab \
--volume /srv/gitlab/logs:/var/log/gitlab \
--volume /srv/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
创建gitlab备份
sudo gitlab-rake gitlab:backup:create
默认备份文件保存在/var/opt/gitlab/backups
目录下。
同步备份文件到备份机上
sudo rsync -avz --delete /var/opt/gitlab/backups root@backup-server:/backup/gitlab
gitlab备份恢复
sudo cp 1493107454_2017_04_25_9.1.0_gitlab_backup.tar /var/opt/gitlab/backups/
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
# Verify
sudo gitlab-ctl status
# This command will overwrite the contents of your GitLab database!
sudo gitlab-rake gitlab:backup:restore BACKUP=1493107454_2017_04_25_9.1.0
sudo gitlab-ctl start
sudo gitlab-rake gitlab:check SANITIZE=true