gitlab常规维护命令

维护命令

查看状态
sudo gitlab-ctl status

启停


# 启动Gitlab所有组件
sudo gitlab-ctl start

# 停止Gitlab所有组件
sudo gitlab-ctl stop

# 重启Gitlab所有组件
sudo gitlab-ctl restart

备份

备份配置

配置文件再/etc/gitlab/ 下面,将所有的配置用tar备份即可

[root@localhost init.d]# cd /etc/gitlab/
[root@localhost gitlab]# ls
gitlab.rb  gitlab-secrets.json  trusted-certs

备份data (以包安装的方式)

[root@localhost ~]# sudo gitlab-rake gitlab:backup:create
Dumping database ... 
Dumping PostgreSQL database gitlabhq_production ... [DONE]
done
Dumping repositories ...
 * root/test1 ... [DONE]
 * root/test1.wiki ...  [SKIPPED]
done
Dumping uploads ... 
done
Dumping builds ... 
done
Dumping artifacts ... 
done
Dumping pages ... 
done
Dumping lfs objects ... 
done
Dumping container registry images ... 
[DISABLED]
Creating backup archive: 1490183942_2017_03_22_gitlab_backup.tar ... done
Uploading backup archive to remote storage  ... skipped
Deleting tmp directories ... done
done
done
done
done
done
done
done
Deleting old backups ... skipping
[root@localhost ~]# ls -lrt
总用量 288
-rw-r--r--. 1 root root  279608 1114 2014 rlwrap-0.42.tar.gz
-rw-------. 1 root root    1886 117 2016 initial-setup-ks.cfg
-rw-------. 1 root root    1608 118 2016 anaconda-ks.cfg
drwxr-xr-x. 2 root root       6 130 2016 桌面
drwxr-xr-x. 2 root root       6 130 2016 下载
drwxr-xr-x. 2 root root       6 130 2016 模板
drwxr-xr-x. 2 root root       6 130 2016 音乐
drwxr-xr-x. 2 root root       6 130 2016 文档
drwxr-xr-x. 2 root root       6 130 2016 图片
drwxr-xr-x. 2 root root       6 130 2016 视频
drwxr-xr-x. 2 root root      34 923 15:21 公共
drwxr-xr-x. 8 yang users   4096 923 16:12 rlwrap-0.42
[root@localhost ~]# find / -name "1490183942_2017_03_22_gitlab_backup.tar"
find: ‘/proc/23513’: 没有那个文件或目录
/var/opt/gitlab/backups/1490183942_2017_03_22_gitlab_backup.tar

恢复数据 (针对以包安装的方式)


[root@localhost ~]# sudo gitlab-ctl stop unicorn
[root@localhost ~]# sudo gitlab-ctl stop sidekiq
[root@localhost ~]# sudo gitlab-ctl status
[root@localhost ~]# sudo gitlab-rake gitlab:backup:restore BACKUP=1490183942_2017_03_22
  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

贤时间

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值