gitlab backups

发布于 2017-03-10 / Linux / 0条评论 / 2,564浏览
#!/bin/bash

echo 'backups start'

# del old backups
rm -rf /var/opt/gitlab/backups/*.tar

# execute gitlab backups
gitlab-rake gitlab:backup:create

# copy to backup server
version=$(date +%Y%m%d%H%M)
scp /var/opt/gitlab/backups/*.tar root@192.168.1.3:/app/backups/gitlab-${version}.tar

echo 'backups end'
评论
站长统计