From 79d845e4807752e32dda880e9ec90e7713239194 Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen.haas@lakedrops.com> Date: Sun, 4 Feb 2024 11:23:20 +0100 Subject: [PATCH] composer/plugin/docker4drupal#66 Update borgmatic config --- templates/backup/config.yaml.twig | 97 +++++++++++++++---------------- 1 file changed, 47 insertions(+), 50 deletions(-) diff --git a/templates/backup/config.yaml.twig b/templates/backup/config.yaml.twig index 866139b..aaa49f8 100644 --- a/templates/backup/config.yaml.twig +++ b/templates/backup/config.yaml.twig @@ -1,58 +1,55 @@ -location: - source_directories: - - /mnt/source - repositories: - - /mnt/borg-repository +source_directories: + - /mnt/source +repositories: + - path: /mnt/borg-repository + label: local {% if backup.remoterepo|default(0) %} - - {{ backup.remoterepo }} + - path: {{ backup.remoterepo }} + label: remote {% endif %} - one_file_system: true - exclude_patterns: - - '*.log' - - '*.pyc' - - '*/.git' - - '*/.svn' - - '*/vendor/*' - - '*/node_modules/*' - exclude_caches: true - exclude_if_present: '.nobackup' +one_file_system: true +exclude_patterns: + - '*.log' + - '*.pyc' + - '*/.git' + - '*/.svn' + - '*/vendor/*' + - '*/node_modules/*' +exclude_caches: true +exclude_if_present: + - '.nobackup' -storage: - # Passphase is set in varibable $BORG_PASSPHRASE - # encryption_passphrase: "DonNotMissToChangeYourPassphrase" - compression: lz4 - archive_name_format: 'backup-{now}' - retries: 3 - retry_wait: 300 +# Passphase is set in varibable $BORG_PASSPHRASE +# encryption_passphrase: "DonNotMissToChangeYourPassphrase" +compression: lz4 +archive_name_format: 'backup-{now}' +retries: 3 +retry_wait: 300 -retention: - keep_hourly: {{ backup.retention.hourly }} - keep_daily: {{ backup.retention.daily }} - keep_weekly: {{ backup.retention.weekly }} - keep_monthly: {{ backup.retention.monthly }} - keep_yearly: {{ backup.retention.yearly }} - prefix: 'backup-' +keep_hourly: {{ backup.retention.hourly }} +keep_daily: {{ backup.retention.daily }} +keep_weekly: {{ backup.retention.weekly }} +keep_monthly: {{ backup.retention.monthly }} +keep_yearly: {{ backup.retention.yearly }} +prefix: 'backup-' -consistency: - checks: - - repository - - archives - check_last: 3 - prefix: 'backup-' +checks: + - name: repository + - name: archives +check_last: 3 -hooks: - mysql_databases: - - name: drupal - hostname: mariadb - port: 3306 - username: drupal - password: drupal - options: '--skip-comments --no-tablespaces' - before_backup: - - echo "`date` - Starting backup" - after_backup: - - echo "`date` - Finished backup" +mysql_databases: + - name: drupal + hostname: mariadb + port: 3306 + username: drupal + password: drupal + options: '--skip-comments --no-tablespaces' +before_backup: + - echo "`date` - Starting backup" +after_backup: + - echo "`date` - Finished backup" {% if alerta is defined %} - on_error: - - echo -n '{"service":["https://www.borgbase.com"],"resource":"{{ HOST_NAME|default('unknown') }}","event":"Borg {configuration_filename}","value":"{repository}","text":"Borg {configuration_filename}","rawData":"{output}"}' | nc -u -w1 alerta {{ alerta.proxy_port|default(20002) }} +on_error: + - echo -n '{"service":["https://www.borgbase.com"],"resource":"{{ HOST_NAME|default('unknown') }}","event":"Borg {configuration_filename}","value":"{repository}","text":"Borg {configuration_filename}","rawData":"{output}"}' | nc -u -w1 alerta {{ alerta.proxy_port|default(20002) }} {% endif %} -- GitLab