2016-10-15 19:31:55 +02:00
|
|
|
#!/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
|