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
Jelle van der Waa b16018992f
Backup gitlab with gitlab-backup tool
Use Gitlab's official backup tool for dumping the database, git
repositories and other data with a wrapper script similiar to the
postgres and mysql backup scripts.

Signed-off-by: Jelle van der Waa <jelle@archlinux.org>
2020-05-24 17:31:37 +02:00

16 lines
478 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 SKIP=tar