sudo gitlab-rake gitlab:backup:create
,默認在/var/opt/gitlab/backups
生成備份文件。/etc/gitlab/gitlab.rb
,設置gitlab_rails['backup_path']
,再運行sudo gitlab-ctl reconfigure
。crontab
設置定時任務,如每天凌晨2點備份,示例腳本可參考相關文檔。sudo gitlab-ctl stop unicorn
和sudo gitlab-ctl stop sidekiq
。sudo gitlab-rake gitlab:backup:restore BACKUP=備份編號
,按提示操作。sudo gitlab-ctl start
。