Commit 3fa8851a authored by Evangelos Foutras's avatar Evangelos Foutras 🐱
Browse files

Merge branch 'fix-stale-db-and-gitlab-backups' into 'master'

Create snapshot with current db and gitlab backups

See merge request !432
parents e1ad24fa 4bc877e6
Pipeline #9126 passed with stage
in 55 seconds
......@@ -39,6 +39,17 @@ cleanup() {
trap cleanup EXIT
# Dump databases to /root/backup-{postgres,mysql} before taking a btrfs snapshot
systemctl is-active postgresql && /usr/local/bin/backup-postgres.sh || true
if systemctl is-active mysqld || systemctl is-active mariadb; then
/usr/local/bin/backup-mysql.sh || true
fi
{% if inventory_hostname == "gitlab.archlinux.org" %}
# Create tarball backups of various GitLab directories using the official backup tool
systemctl is-active docker && /usr/local/bin/backup-gitlab.sh
{% endif %}
if is_btrfs "$src"; then
# List all btrfs submounts we want to backup, e.g. homedir.archlinux.org with "/ /home"
list_of_btrfs_submounts=$(findmnt -Rl -o target,fstype,options / | grep btrfs | grep -v docker | grep -v "subvol=\/[[:alnum:]]" | cut -d ' ' -f1)
......@@ -62,15 +73,6 @@ else
backup_mountdir="$src"
fi
systemctl is-active postgresql && /usr/local/bin/backup-postgres.sh || true
if systemctl is-active mysqld || systemctl is-active mariadb; then
/usr/local/bin/backup-mysql.sh || true
fi
{% if inventory_hostname == "gitlab.archlinux.org" %}
systemctl is-active docker && /usr/local/bin/backup-gitlab.sh
{% endif %}
borg create -v --stats -C zstd \
-e /proc \
-e /sys \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment