zoukankan      html  css  js  c++  java
  • gitlab备份迁移

    一. 创建备份文件

    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

  • 相关阅读:
    JVM类加载的过程
    接口文档设计
    代码规范及CodeReview要点
    Linux权限
    Linux文件
    UltraEdit编辑器基础技巧
    Android环境配置
    JDK 环境配置
    xml没有提示解决办法<eclipse>
    mysql事务实例
  • 原文地址:https://www.cnblogs.com/gandefeng/p/14275741.html
Copyright © 2011-2022 走看看