搭建个人Gitlab仓库可以更好地维护迭代频繁的代码或者文字方案,为确保重要数据的安全性,定期备份Gitlab数据是非常重要的,本篇文章重点为大家讲解一下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
以上就是良许教程网为各位朋友分享的Linu系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !
