14 lines
441 B
Bash
Executable File
14 lines
441 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# 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/
|
|
sh -c 'umask 0077; tar -cf $(date "+%F+etc-gitlab-%s.tar") -C / etc/gitlab'
|
|
|
|
# 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 |