gitlab之六: gitlab 备份恢复
参考: https://blog.csdn.net/ouyang_peng/article/details/77070977
备份: 所有的权限,库文件等信息全部备份到的
不更改备份目录的话:
vim /etc/gitlab/gitlab.rb 去掉下面2行的注释 gitlab_rails['backup_path'] = "/var/opt/gitlab/backups" gitlab_rails['backup_keep_time'] = 604800 #备份保存的时间默认7天
gitlab-rake gitlab:backup:create #备份
#备份后的文件如下:
root@A1-Back:/var/opt/gitlab/backups# ls -alh 1543808802_2018_12_03_11.0.0_gitlab_backup.tar
-rw------- 1 git git 80K Dec 3 11:46 1543808802_2018_12_03_11.0.0_gitlab_backup.tar
gitlab-ctl stop
gitlab-ctl reconfigure
恢复:
删掉项目进行模拟恢复.
# 停止相关数据连接服务 gitlab-ctl stop unicorn gitlab-ctl stop sidekiq gitlab-rake gitlab:backup:restore BACKUP=备份文件编号
gitlab-rake gitlab:backup:restore BACKUP=1543808802_2018_12_03_11.0.0
gitlab-ctl restart
一搭搭
二搭搭
三搭搭