From 5c35be0aa7fc8762c78f95f48d3e24d47bada53f Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Thu, 24 Sep 2020 09:55:41 +0200 Subject: [PATCH] Move multiple backup configs to backup.d --- borgmatic.yml => backup.d/borgmatic.yml | 0 .../fr_microsites_wordpress.yml | 6 +-- backup.d/fr_singlesite_wordpress.yml | 47 +++++++++++++++++++ 3 files changed, 50 insertions(+), 3 deletions(-) rename borgmatic.yml => backup.d/borgmatic.yml (100%) rename compose.backup.yml => backup.d/fr_microsites_wordpress.yml (87%) create mode 100644 backup.d/fr_singlesite_wordpress.yml diff --git a/borgmatic.yml b/backup.d/borgmatic.yml similarity index 100% rename from borgmatic.yml rename to backup.d/borgmatic.yml diff --git a/compose.backup.yml b/backup.d/fr_microsites_wordpress.yml similarity index 87% rename from compose.backup.yml rename to backup.d/fr_microsites_wordpress.yml index 7618f60..59af0da 100644 --- a/compose.backup.yml +++ b/backup.d/fr_microsites_wordpress.yml @@ -17,7 +17,7 @@ services: - source: borgmatic_config_yml target: /etc/borgmatic/config.yaml environment: - - BORGBASE_REPO="g067e243@g067e243.repo.borgbase.com:repo" + - BORGBASE_REPO="bp5oj726@bp5oj726.repo.borgbase.com:repo" - DB_HOST=mariadb - DB_TABLE=wordpress - DB_USER=wordpress @@ -34,7 +34,7 @@ services: configs: borgmatic_config_yml: - name: borgmatic_config_yml_v7 + name: borgmatic_config_yml_v1 file: borgmatic.yml template_driver: golang @@ -43,5 +43,5 @@ secrets: name: backup_bot_ssh_key_v1 external: true backup_bot_password: - name: backup_bot_password_v1 + name: backup_bot_multisite_passwd_v1 external: true diff --git a/backup.d/fr_singlesite_wordpress.yml b/backup.d/fr_singlesite_wordpress.yml new file mode 100644 index 0000000..426f4a5 --- /dev/null +++ b/backup.d/fr_singlesite_wordpress.yml @@ -0,0 +1,47 @@ +--- +version: "3.8" + +services: + backupbot: + image: "decentral1se/backup-bot:0.0.1" + networks: + - backend + volumes: + - "wordpress_content:/var/www/html/wp-content/" + secrets: + - source: backup_bot_ssh_key + mode: 0400 + - backup_bot_password + - db_password + configs: + - source: borgmatic_config_yml + target: /etc/borgmatic/config.yaml + environment: + - BORGBASE_REPO="l32s99em@l32s99em.repo.borgbase.com:repo" + - DB_HOST=mariadb + - DB_TABLE=wordpress + - DB_USER=wordpress + deploy: + mode: replicated + replicas: 0 + labels: + - "swarm.cronjob.enable=true" + - "swarm.cronjob.schedule=0 2 * * *" # At 02:00 + restart_policy: + condition: none + networks: + - backend + +configs: + borgmatic_config_yml: + name: borgmatic_config_yml_v1 + file: borgmatic.yml + template_driver: golang + +secrets: + backup_bot_ssh_key: + name: backup_bot_ssh_key_v1 + external: true + backup_bot_password: + name: backup_bot_singlesite_passwd_v1 + external: true