标簽(linux): git
配置檔案中加入
gitlab_rails['bakup_path']='/data/backup/gitlab'
gitlab_rails['backup_keep_time']=604800
重新開機配置gitlab-ctl reconfigure
gitlab-ctl restart
如果自定義備份目錄需要賦予git權限
mkdir /data/backup/gitlab
chown -R git.git /data/backup/gitlab
定時任務crontab中加入
0 2 * * * /usr/bin/gitlab-rake gitlab:backup:create
政策建議:本地保留三到七天,在異地備份永久儲存
停止資料寫入服務
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-rake gitlab:backup:restore BACKUP=1492296095
date -d @1492296095