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
以上就是良许教程网为各位朋友分享的Linux系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !