码迷,mamicode.com
首页 > 其他好文 > 详细

GitLab项目批量备份,迁移

时间:2019-05-27 15:05:49      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:机器   roo   部分   mod   gitlab备份   bin   res   项目   迁移   

一. 创建备份文件

gitlab-rake gitlab:backup:create

使用以上命令会在/var/opt/gitlab/backups目录下创建一个名称类似为1547087542_2019_01_10_11.0.3_gitlab_backup.tar的压缩包, 这个压缩包就是Gitlab整个的完整部分, 其中开头的1547087542_2019_01_10_11.0.3是备份创建的日期

scp /var/opt/gitlab/backups/1547087542_2019_01_10_11.0.3_gitlab_backup.tar 192.168.61.28:/var/opt/gitlab/backups/

目标机器操作:

chmod 777 /var/opt/gitlab/backups/1547087542_2019_01_10_11.0.3_gitlab_backup.tar

gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-rake gitlab:backup:restore BACKUP=1547087542_2019_01_10_11.0.3
gitlab-ctl start

二.定时备份:

添加定时任务,每天凌晨两点,执行gitlab备份

0 2 * root /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1

GitLab项目批量备份,迁移

标签:机器   roo   部分   mod   gitlab备份   bin   res   项目   迁移   

原文地址:https://blog.51cto.com/shunzi115/2400685

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!