more gitlab backup

This commit is contained in:
Matthias Kretschmann 2017-01-21 01:20:27 +01:00
parent e163f941df
commit d0bd25c235
Signed by: m
GPG Key ID: BD3C1F3EDD7831FC

View File

@ -1,11 +1,17 @@
#!/usr/bin/env bash
#
# needs to run as root
#
# setup as cron job:
#
# sudo crontab -e
# 0 2 * * * /bin/gitlab-backup.sh
#
# 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'
sh -c 'umask 0077; tar -cf $(date "+%s-%F-etc-gitlab.tar") -C / etc/gitlab'
# run GitLab system backup
gitlab-rake gitlab:backup:create CRON=1