GitLab中对数据进行备份具体实现方法

树叶云

GitLab 是 Ruby 开发的自托管的 Git 项目仓库,可通过Web界面进行访问公开的或者私人项目,本篇文章重点为大家分享一下GitLab中对数据进行备份的具体方法。

1,全备份

集成包安装:
# gitlab-rake gitlab:backup:create

源码安装
# git -H bundle exec rake gitlab:backup:create RAILS_ENV=production

docker安装
# docker exec -t  gitlab-rake gitlab:backup:create

2,部分备份

db (数据库) uploads (附件) repositories (代码库) builds (CI作业输出日志) artifacts (CI工件) lfs (LFS对象) registry (注册图片) pages (页面内容)

集成包安装:
# gitlab-rake gitlab:backup:create SKIP=uploads,repositories,builds,artifacts,lfs,registry,pages

源码安装
# git -H bundle exec rake gitlab:backup:create SKIP=uploads,repositories RAILS_ENV=production

docker安装
# docker exec -t  gitlab-rake gitlab:backup:create SKIP=uploads,registry,pages

3,crontab

集成包安装:
0 7 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1

源码安装
0 7 * * * cd /gitlab目录 && PATH=/usr/local/bin:/usr/bin:/bin bundle exec rake gitlab:backup:create RAILS_ENV=production CRON=1

docker安装
0 7 * * * /bin/docker exec -t  /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/220272.html<

(0)
运维的头像运维
上一篇2025-04-14 12:07
下一篇 2025-04-14 12:08

相关推荐

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注