天天看点

Gitlab备份与恢复[七]

标签(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

继续阅读