1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/borg_client/templates/backup-gitlab.sh.j2
Sven-Hendrik Haase 636613f445
Try to make GitLab backups more reliable
Sometimes we'd get failures if files changed while backing them up.
See https://docs.gitlab.com/ee/raketasks/backup_restore.html#backup-strategy-option
for documentation on the fix.
This fixes #200.
2020-10-25 05:49:45 +01:00

16 lines
492 B
Django/Jinja

#!/bin/bash
#
# Script to backup Gitlab running in a Docker container
#
# https://docs.gitlab.com/omnibus/settings/backups.html#creating-backups-for-gitlab-instances-in-docker-containers
#
backupdir="{{ gitlab_backupdir }}"
echo "emptying backup directory ${backupdir}"
# Verify that the gitlab_backupdir in ansible was defined, otherwise we will rm /* and remove the previous backup
rm -r "${backupdir:?backup dir unset}/"*
docker exec gitlab gitlab-backup create STRATEGY=copy SKIP=tar