配置gitlab自动备份

在gitlab机器的root用户执行

首先,假设有2台机器。

  1. gitlab 1.1.1.1
  2. backup 2.2.2.2

做秘钥信任

  1. gitlab root 生成 ssh-key
  2. copy密钥到backup机器的ubuntu用户。
  3. clone 自动备份脚本
  4. 配置自动备份任务
  5. 配置定时任务
ssh-keygen -t rsa

ssh-copy-id ubuntu@2.2.2.2

root@gitlab # git clone https://github.com/sund/auto-gitlab-backup.git
remoteUser="ubuntu"
remoteServer="2.2.2.2" # remote ip
remoteDest="/home/ubuntu/gitlab-backup"
backupConfigs="1"
contab -e

5 5 * * * /root/auto-gitlab-backup/auto-gitlab-backup.sh > /dev/null 2>&1 &

auto-gitlab-backup.sh的rsync支持daemon格式,也支持直接从ssh协议同步。
我配置daemon折腾了好久,没成功。。。

原文地址:https://www.cnblogs.com/morya/p/6575062.html