{"id":145298,"date":"2019-06-08T08:13:14","date_gmt":"2019-06-08T00:13:14","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=145298"},"modified":"2019-05-27T09:14:05","modified_gmt":"2019-05-27T01:14:05","slug":"gitlab-copy","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/gitlab-copy.html","title":{"rendered":"\u5982\u4f55\u5728gitlab \u6570\u636e\u5907\u4efd"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\ngitlab\u7684\u9ed8\u8ba4\u5907\u4efd\u8def\u5f84\u662f\/var\/opt\/gitlab\/backups\/\uff0c\u53ef\u4ee5\u901a\u8fc7gitlab.rb\u6765\u4fee\u6539\u8fd9\u4e2a\u914d\u7f6e\u8def\u5f84\uff0cgitlab_rails['backup_path'] = \"\/data\/pgsql_bak\"<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
1\uff0c\u5168\u5907\u4efd<\/strong><\/div>\n
\r\n\u96c6\u6210\u5305\u5b89\u88c5\uff1a\r\n# gitlab-rake gitlab:backup:create\r\n\r\n\u6e90\u7801\u5b89\u88c5\r\n# git -H bundle exec rake gitlab:backup:create RAILS_ENV=production\r\n\r\ndocker\u5b89\u88c5\r\n# docker exec -t <\u5bb9\u5668\u540d> gitlab-rake gitlab:backup:create<\/pre>\n
2\uff0c\u90e8\u5206\u5907\u4efd<\/strong><\/div>\n

db (\u6570\u636e\u5e93)
\nuploads (\u9644\u4ef6)
\nrepositories (\u4ee3\u7801\u5e93)
\nbuilds (CI\u4f5c\u4e1a\u8f93\u51fa\u65e5\u5fd7)
\nartifacts (CI\u5de5\u4ef6)
\nlfs (LFS\u5bf9\u8c61)
\nregistry (\u6ce8\u518c\u56fe\u7247)
\npages (\u9875\u9762\u5185\u5bb9\uff09<\/p>\n

\r\n\u96c6\u6210\u5305\u5b89\u88c5\uff1a\r\n# gitlab-rake gitlab:backup:create SKIP=uploads,repositories,builds,artifacts,lfs,registry,pages\r\n\r\n\u6e90\u7801\u5b89\u88c5\r\n# git -H bundle exec rake gitlab:backup:create SKIP=uploads,repositories RAILS_ENV=production\r\n\r\ndocker\u5b89\u88c5\r\n# docker exec -t <\u5bb9\u5668\u540d> gitlab-rake gitlab:backup:create SKIP=uploads,registry,pages<\/pre>\n
3\uff0ccrontab<\/strong><\/div>\n
\r\n\u96c6\u6210\u5305\u5b89\u88c5\uff1a\r\n0 7 * * * \/opt\/gitlab\/bin\/gitlab-rake gitlab:backup:create CRON=1\r\n\r\n\u6e90\u7801\u5b89\u88c5\r\n0 7 * * * cd \/gitlab\u76ee\u5f55 && PATH=\/usr\/local\/bin:\/usr\/bin:\/bin bundle exec rake gitlab:backup:create RAILS_ENV=production CRON=1\r\n\r\ndocker\u5b89\u88c5\r\n0 7 * * * \/bin\/docker exec -t <\u5bb9\u5668\u540d> \/opt\/gitlab\/bin\/gitlab-rake gitlab:backup:create CRON=1<\/pre>\n","protected":false},"excerpt":{"rendered":"

\u96c6\u6210\u5305\u5b89\u88c5\uff1a # gitlab-rake gitlab:backup:create \u6e90\u7801\u5b89\u88c5 # git -H […]<\/p>\n","protected":false},"author":63,"featured_media":146327,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-145298","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/145298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=145298"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/145298\/revisions"}],"predecessor-version":[{"id":146430,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/145298\/revisions\/146430"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/146327"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=145298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=145298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=145298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}