鄂破机看 发表于 2018-1-11 13:43:25

配置gitlab自动备份

  在gitlab机器的root用户执行
  首先,假设有2台机器。


[*]gitlab 1.1.1.1
[*]backup 2.2.2.2
做秘钥信任


[*]gitlab root 生成 ssh-key
[*]copy密钥到backup机器的ubuntu用户。
[*]clone 自动备份脚本
[*]配置自动备份任务
[*]配置定时任务
  

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折腾了好久,没成功。。。
页: [1]
查看完整版本: 配置gitlab自动备份