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