1
1
Fork 0
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2024-05-27 01:56:10 +02:00

Avoid running backup-gitlab twice; reuse tarballs

The official backup tool for GitLab takes many hours to run because it
puts everything inside tarballs and then gzips each one. It seems safe
and much more efficient to skip this step for the offsite backup while
reusing the tarballs generated by the first backup to the Storage Box.

Should save ~5 hours from the borg-backup-offsite.service execution.
This commit is contained in:
Evangelos Foutras 2021-07-09 04:28:23 +03:00
parent ef3e01ce61
commit 5c953c00fc
No known key found for this signature in database
GPG Key ID: 51E8B148A9999C34
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,10 @@
[Unit]
Description=Borg backup
{% if inventory_hostname == "gitlab.archlinux.org" %}
# The ordering relation defined below is important for the GitLab backups
# because the offsite backup reuses the tarballs from this service's run.
{% endif %}
Wants=borg-backup-offsite.service
Before=borg-backup-offsite.service

View File

@ -45,7 +45,8 @@ if systemctl is-active mysqld || systemctl is-active mariadb; then
/usr/local/bin/backup-mysql.sh || true
fi
{% if inventory_hostname == "gitlab.archlinux.org" %}
{# When backing up to offsite, reuse the existing tarballs from the previous backup #}
{% if inventory_hostname == "gitlab.archlinux.org" and item['suffix'] != '-offsite' %}
# Create tarball backups of various GitLab directories using the official backup tool
systemctl is-active docker && /usr/local/bin/backup-gitlab.sh
{% endif %}