Sep 22, 2021 No Comments 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 ~]# find / -name "1490183942_2017_03_22_gitlab_backup.tar" /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 ``` 最后更新于 2021-09-22 17:21:14 并被添加「」标签,已有 2557 位童鞋阅读过。 本站使用「署名 4.0 国际」创作共享协议,可自由转载、引用,但需署名作者且注明文章出处
此处评论已关闭