dotfiles-server/bin/gitlab-backup.sh

14 lines
441 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2016-05-07 22:03:04 +02:00
# needs to run as root
# Create a time-stamped .tar file in the current directory.
# The .tar file will be readable only to root.
cd /var/opt/gitlab/backups/
2017-01-21 01:11:07 +01:00
sh -c 'umask 0077; tar -cf $(date "+%F+etc-gitlab-%s.tar") -C / etc/gitlab'
2016-05-07 22:03:04 +02:00
2017-01-21 01:11:07 +01:00
# run GitLab system backup
gitlab-rake gitlab:backup:create CRON=1
# sync with Google Cloud Storage bucket
/home/m/code/google-cloud-sdk/bin/gsutil rsync -r . gs://git-berlin-backups