gitlab repo&backup目录切换
公司搭建gitlab,踩踩坑
一.修改backups目录
1. gailab backup目录切换:
mkdir -p /gitlab/backups #创建目录
chown git:root /gitlab #改变属主为git
chown git:git /gitlab/backups #属组属主都为git
2.修改配置文件 vi /etc/gitlab/gitlab.rc
gitlab_rails['manage_backup_path'] = true
gitlab_rails['backup_path'] = "/gitlab/backups" #backup家目录
gitlab_rails['backup_archive_permissions'] = 0644 #权限644
gitlab_rails['backup_keep_time'] = 604800 #604800秒即7day
二. repo目录切换:
1. 创建目录:
mkdir -p /data/git-data
chown -R git:root /data/git-data
2.修改配置文件:
vi /etc/gitlab/gitlab.rc
git_data_dirs({
"default" => {
"path" => "/data/git-data" #此为repo新路径
}
})
3.重启gitlab使上述配置生效
gitlab-ctl reconfigure
gitlab-ctl restart
over!!!