gitlab repo&backup目錄切換
阿新 • • 發佈:2018-11-06
公司搭建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!!!