[root@test102~]# ll /var/opt/gitlab/backups/
total 0[root@test102~]# gitlab-rake gitlab:backup:create # 備份數據2019-11-2716:12:08+0800-- Dumping database ...
Dumping PostgreSQL database gitlabhq_production ...[DONE]2019-11-2716:12:10+0800-- done2019-11-2716:12:10+0800-- Dumping repositories ...2019-11-2716:12:10+0800-- done2019-11-2716:12:10+0800-- Dumping uploads ... 2019-11-2716:12:10+0800-- done2019-11-2716:12:10+0800-- Dumping builds ... 2019-11-2716:12:10+0800-- done2019-11-2716:12:10+0800-- Dumping artifacts ... 2019-11-2716:12:10+0800-- done2019-11-2716:12:10+0800-- Dumping pages ... 2019-11-2716:12:10+0800-- done2019-11-2716:12:10+0800-- Dumping lfs objects ... 2019-11-2716:12:10+0800-- done2019-11-2716:12:10+0800-- Dumping container registry images ... 2019-11-2716:12:10+0800-- [DISABLED]
Creating backup archive: 1574842330_2019_11_27_12.5.0_gitlab_backup.tar ... done
Uploading backup archive to remote storage ... skipped
Deleting tmp directories ... done
done
done
done
done
done
done
done
Deleting old backups ... done.(0 removed)
Warning: Your gitlab.rb and gitlab-secrets.json files contain sensitive dataand are not included in this backup. You will need these files torestore a backup.
Please back them up manually.Backup task is done.[root@test102~]# [root@test102~]# ll /var/opt/gitlab/backups/
total 172-rw-r--r-- 1 git git 174080 Nov 27 16:12 1574842330_2019_11_27_12.5.0_gitlab_backup.tar[root@test102~]#
回到頂部
3 - 定時備份
使用Crontab任務進行定時備份。
[root@test102~]# crontab -l
no crontab for root
[root@test102~]# [root@test102~]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
[root@test102~]# [root@test102~]# crontab -l02***/opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=102***/opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1[root@test102~]#