backup-gitlab.sh.j2 478 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/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