mirror of
https://gitlab.archlinux.org/archlinux/infrastructure.git
synced 2025-01-18 08:06:16 +01:00
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.
16 lines
492 B
Django/Jinja
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
|