Skip to content
Snippets Groups Projects

Create snapshot with current db and gitlab backups

Merged Evangelos Foutras requested to merge fix-stale-db-and-gitlab-backups into master
1 file
+ 11
9
Compare changes
  • Side-by-side
  • Inline
@@ -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 \
Loading