Gitlab 更换备份路径
背景:当 /
目录下磁盘空间不足的时候,GitLab 会启动失败也会备份失败,故需要更改 GitLab 的备份路径:
默认路径是/var/opt/gitlab/backups
1.创建 GitLab 备份文件目录
这里选择剩余空间最大的 /home
目录:
mkdir -p /home/gitlab/backups
2.修改 GitLab 配置文件
vim /etc/gitlab/gitlab.rb
修改内容:
gitlab_rails['backup_path'] = "/home/gitlab/backups"
注意:原先此项参数是被注解的,这里需要删除
#
并修改后面的路径
3.停止当前 GitLab,重新加载配置
gitlab-ctl stop
gitlab-ctl reconfigure
4.最后启动 GitLab
gitlab-ctl start
当 GitLab 页面加载出来后,尝试使用 /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1
看看新备份文件夹下会不会生成新的备份文件,如果有,则表示备份成工。