|NO.Z.00016|——————————|CloudNative|——|CI/CD&GitLab操作 .V06|——|GitLab.备份|定时备份|

一、查看系统信息
### --- 查看系统信息
~~~     查看系统版本和软件版本

[root@server11 ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core) 
[root@server11 ~]# cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
13.10.0
二、gitlab备份
### --- 查看备份相关的配置
~~~     查看gitlab备份参数
~~~     该项定义了默认备份出文件的路径,可以通过修改该配置,
~~~     并执行 gitlab-ctl reconfigure 或者 gitlab-ctl restart 重启服务生效。

[root@qfedu.com ~]# vim /etc/gitlab/gitlab.rb
gitlab_rails['manage_backup_path'] = true
gitlab_rails['backup_path'] = "/data/gitlab/backups"
### --- 重启gitlab server

[root@server11 ~]# gitlab-ctl restart
### --- 备份gitlab

[root@server11 ~]# /opt/gitlab/bin/gitlab-rake gitlab:backup:create
三、定时备份
### --- gitlab定时备份
~~~     可以到/data/gitlab/backups找到备份包,解压查看,
~~~     会发现备份的还是比较全面的,数据库、repositories、build、upload等分类还是比较清晰的。

[root@qfedu.com ~]# crontab -e
0 2 * * * bash /opt/gitlab/bin/gitlab-rake gitlab:backup:create
四、设置备份保留时长
### --- 防止每天执行备份,有目录被爆满的风险,
~~~     打开/etc/gitlab/gitlab.rb配置文件,找到如下配置:
~~~     设置备份保留7天(7360024=604800),秒为单位,如果想增大或减小,
~~~     可以直接在该处配置,并通过gitlab-ctl restart 重启服务生效。
~~~     备份完成,会在备份目录中生成一个当天日期的tar包。

[root@qfedu.com ~]# vim /etc/gitlab/gitlab.rb
gitlab_rails['backup_keep_time'] = 604800

 
 
 
 
 
 
 
 
 

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor

 

 

posted on   yanqi_vip  阅读(25)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示