Skip to content
Snippets Groups Projects
Commit 5d65bff6 authored by jurgenhaas's avatar jurgenhaas
Browse files

#4 Update borgmatic configuration

parent 62282c66
No related branches found
No related tags found
No related merge requests found
location:
source_directories:
- /mnt/source
repositories:
- /mnt/borg-repository
source_directories:
- /mnt/source
repositories:
- path: /mnt/borg-repository
label: local
{% if application_remote_repo %}
- {{ application_remote_repo }}
- path: {{ application_remote_repo }}
label: remote
{% endif %}
one_file_system: true
exclude_patterns:
- '*.log'
- '*.pyc'
- '*/.git'
- '*/.svn'
- '*/vendor/*'
- '*/node_modules/*'
exclude_caches: true
exclude_if_present: '.nobackup'
storage:
encryption_passphrase: '{{ borg_passphrase }}'
retries: {{ borgbackup.retries|default(1) }}
retry_wait: 300
retention:
keep_daily: 7
keep_weekly: 8
keep_monthly: 12
keep_yearly: 30
consistency:
checks:
- repository
- archives
hooks:
one_file_system: true
exclude_patterns:
- '*.log'
- '*.pyc'
- '*/.git'
- '*/.svn'
- '*/vendor/*'
- '*/node_modules/*'
exclude_caches: true
exclude_if_present:
- '.nobackup'
encryption_passphrase: '{{ borg_passphrase }}'
retries: {{ borgbackup.retries|default(1) }}
retry_wait: 300
keep_daily: 7
keep_weekly: 8
keep_monthly: 12
keep_yearly: 30
checks:
- name: repository
- name: archives
{% if application_db is defined %}
mysql_databases:
- name: '{{ application_db }}'
hostname: db
port: 3306
username: '{{ application_db }}'
password: '{{ application_db }}'
options: '--skip-comments --no-tablespaces'
mysql_databases:
- name: '{{ application_db }}'
hostname: db
port: 3306
username: '{{ application_db }}'
password: '{{ application_db }}'
options: '--skip-comments --no-tablespaces'
{% endif %}
before_backup:
- echo "`date` - Starting backup"
after_backup:
- echo "`date` - Finished backup"
before_backup:
- echo "`date` - Starting backup"
after_backup:
- echo "`date` - Finished backup"
{% if alerta_apikey is defined %}
on_error:
- echo -n '{"service":["https://www.borgbase.com"],"resource":"{{ inventory_hostname }}","event":"Borg {configuration_filename}","value":"{{ application }} {{ application_id }} {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":"{{ inventory_hostname }}","event":"Borg {configuration_filename}","value":"{{ application }} {{ application_id }} {repository}","text":"Borg {configuration_filename}","rawData":"{output}"}' | nc -u -w1 alerta {{ alerta_proxy_port|default(20002) }}
{% endif %}
location:
source_directories:
source_directories:
{% if application_mountpoints|default(false) %}
{% for mountpoint in application_mountpoints %}
- {{ mountpoint.path }}
- {{ mountpoint.path }}
{% endfor %}
{% else %}
- {{ application_dir }}
- {{ application_dir }}
{% endif %}
repositories:
repositories:
{% if not application_disable_local %}
- /var/backups/borg/{{ application }}_{{ application_id }}
- path: /var/backups/borg/{{ application }}_{{ application_id }}
label: local
{% endif %}
{% if application_remote_repo %}
- {{ application_remote_repo }}
- path: {{ application_remote_repo }}
label: remote
{% endif %}
one_file_system: true
exclude_patterns:
- '*.log'
- '*.pyc'
- '*/.git'
- '*/.svn'
- '*/vendor/*'
- '*/node_modules/*'
exclude_caches: true
exclude_if_present: '.nobackup'
storage:
encryption_passphrase: '{{ borgbackup.passphrase }}'
retries: {{ borgbackup.retries|default(1) }}
retry_wait: 300
retention:
keep_daily: 7
keep_weekly: 8
keep_monthly: 12
keep_yearly: 30
consistency:
checks:
- repository
- archives
hooks:
before_backup:
- echo "`date` - Starting backup"
after_backup:
- echo "`date` - Finished backup"
on_error:
- /usr/local/bin/alertalerta.py{% if netdata_alerta_project_id is defined %} --pid={{ netdata_alerta_project_id }}{% endif %} {{ inventory_hostname }} {{ netdata_alerta_environment|default("production") }} {{ netdata_alerta_webhook }} {{ netdata_alerta_apikey }} '{"service":["https://www.borgbase.com"],"resource":"{{ inventory_hostname }}","event":"Borg {configuration_filename}","value":"{{ application }} {{ application_id }} {repository}","text":"Borg {configuration_filename}","rawData":"{output}"}'
one_file_system: true
exclude_patterns:
- '*.log'
- '*.pyc'
- '*/.git'
- '*/.svn'
- '*/vendor/*'
- '*/node_modules/*'
exclude_caches: true
exclude_if_present:
- '.nobackup'
encryption_passphrase: '{{ borgbackup.passphrase }}'
retries: {{ borgbackup.retries|default(1) }}
retry_wait: 300
keep_daily: 7
keep_weekly: 8
keep_monthly: 12
keep_yearly: 30
checks:
- name: repository
- name: archives
before_backup:
- echo "`date` - Starting backup"
after_backup:
- echo "`date` - Finished backup"
on_error:
- /usr/local/bin/alertalerta.py{% if netdata_alerta_project_id is defined %} --pid={{ netdata_alerta_project_id }}{% endif %} {{ inventory_hostname }} {{ netdata_alerta_environment|default("production") }} {{ netdata_alerta_webhook }} {{ netdata_alerta_apikey }} '{"service":["https://www.borgbase.com"],"resource":"{{ inventory_hostname }}","event":"Borg {configuration_filename}","value":"{{ application }} {{ application_id }} {repository}","text":"Borg {configuration_filename}","rawData":"{output}"}'
location:
source_directories:
source_directories:
{% if application_mountpoints|default(false) %}
{% for mountpoint in application_mountpoints %}
- {{ mountpoint.path }}
- {{ mountpoint.path }}
{% endfor %}
{% else %}
- {{ application_dir }}
- {{ application_dir }}
{% endif %}
repositories:
- /var/backups/borg/{{ application }}_{{ application_id }}
one_file_system: true
exclude_patterns:
- '*.log'
- '*.pyc'
- '*/.git'
- '*/.svn'
- '*/vendor/*'
- '*/node_modules/*'
exclude_caches: true
exclude_if_present: '.nobackup'
storage:
encryption_passphrase: '{{ borgbackup.passphrase }}'
retries: 1
retry_wait: 300
retention:
keep_daily: 7
keep_weekly: 8
keep_monthly: 12
keep_yearly: 30
consistency:
checks:
- archives
- data
- repository
hooks:
before_backup:
- echo "`date` - Starting backup"
after_backup:
- echo "`date` - Finished backup"
on_error:
- /usr/local/bin/alertalerta.py{% if netdata_alerta_project_id is defined %} --pid={{ netdata_alerta_project_id }}{% endif %} {{ inventory_hostname }} {{ netdata_alerta_environment|default("production") }} {{ netdata_alerta_webhook }} {{ netdata_alerta_apikey }} '{"service":["https://www.borgbase.com"],"resource":"{{ inventory_hostname }}","event":"Borg {configuration_filename}","value":"{{ application }} {{ application_id }} {repository}","text":"Borg {configuration_filename}","rawData":"{output}"}'
repositories:
- path: /var/backups/borg/{{ application }}_{{ application_id }}
label: local
one_file_system: true
exclude_patterns:
- '*.log'
- '*.pyc'
- '*/.git'
- '*/.svn'
- '*/vendor/*'
- '*/node_modules/*'
exclude_caches: true
exclude_if_present:
- '.nobackup'
encryption_passphrase: '{{ borgbackup.passphrase }}'
retries: 1
retry_wait: 300
keep_daily: 7
keep_weekly: 8
keep_monthly: 12
keep_yearly: 30
checks:
- name: archives
- name: data
- name: repository
before_backup:
- echo "`date` - Starting backup"
after_backup:
- echo "`date` - Finished backup"
on_error:
- /usr/local/bin/alertalerta.py{% if netdata_alerta_project_id is defined %} --pid={{ netdata_alerta_project_id }}{% endif %} {{ inventory_hostname }} {{ netdata_alerta_environment|default("production") }} {{ netdata_alerta_webhook }} {{ netdata_alerta_apikey }} '{"service":["https://www.borgbase.com"],"resource":"{{ inventory_hostname }}","event":"Borg {configuration_filename}","value":"{{ application }} {{ application_id }} {repository}","text":"Borg {configuration_filename}","rawData":"{output}"}'
location:
source_directories:
- /etc
source_directories:
- /etc
{% for dir in backup_include|default([]) %}
- {{ dir }}
- {{ dir }}
{% endfor %}
{% if groups['dbserver_mysql'] is defined and inventory_hostname in groups['dbserver_mysql'] %}
- /var/backups/mysql
- /var/backups/mysql
{% endif %}
repositories:
- /var/backups/borg/default
one_file_system: true
exclude_patterns:
- '*.log'
- '*.pyc'
- '*/.git'
- '*/.svn'
- '*/vendor/*'
- '*/node_modules/*'
exclude_caches: true
exclude_if_present: '.nobackup'
storage:
encryption_passphrase: '{{ borgbackup.passphrase }}'
retries: 1
retry_wait: 300
retention:
keep_daily: 7
keep_weekly: 8
keep_monthly: 12
keep_yearly: 30
consistency:
checks:
- archives
- data
- repository
hooks:
before_backup:
- echo "`date` - Starting backup"
after_backup:
- echo "`date` - Finished backup"
on_error:
- /usr/local/bin/alertalerta.py{% if netdata_alerta_project_id is defined %} --pid={{ netdata_alerta_project_id }}{% endif %} {{ inventory_hostname }} {{ netdata_alerta_environment|default("production") }} {{ netdata_alerta_webhook }} {{ netdata_alerta_apikey }} '{"service":["https://www.borgbase.com"],"resource":"{{ inventory_hostname }}","event":"Borg {configuration_filename}","value":"{repository}","text":"Borg {configuration_filename}","rawData":"{output}"}'
repositories:
- path: /var/backups/borg/default
label: local
one_file_system: true
exclude_patterns:
- '*.log'
- '*.pyc'
- '*/.git'
- '*/.svn'
- '*/vendor/*'
- '*/node_modules/*'
exclude_caches: true
exclude_if_present:
- '.nobackup'
encryption_passphrase: '{{ borgbackup.passphrase }}'
retries: 1
retry_wait: 300
keep_daily: 7
keep_weekly: 8
keep_monthly: 12
keep_yearly: 30
checks:
- name: archives
- name: data
- name: repository
before_backup:
- echo "`date` - Starting backup"
after_backup:
- echo "`date` - Finished backup"
on_error:
- /usr/local/bin/alertalerta.py{% if netdata_alerta_project_id is defined %} --pid={{ netdata_alerta_project_id }}{% endif %} {{ inventory_hostname }} {{ netdata_alerta_environment|default("production") }} {{ netdata_alerta_webhook }} {{ netdata_alerta_apikey }} '{"service":["https://www.borgbase.com"],"resource":"{{ inventory_hostname }}","event":"Borg {configuration_filename}","value":"{repository}","text":"Borg {configuration_filename}","rawData":"{output}"}'
location:
source_directories:
- /etc
source_directories:
- /etc
{% for dir in backup_include|default([]) %}
- {{ dir }}
- {{ dir }}
{% endfor %}
{% if groups['dbserver_mysql'] is defined and inventory_hostname in groups['dbserver_mysql'] %}
- /var/backups/mysql
- /var/backups/mysql
{% endif %}
repositories:
repositories:
{% if not borgbackup.disable_local|default(false) %}
- /var/backups/borg/default
- path: /var/backups/borg/default
label: local
{% endif %}
{% if borgbackup.remote_repo is defined %}
- {{ borgbackup.remote_repo }}
- path: {{ borgbackup.remote_repo }}
label: remote
{% endif %}
one_file_system: true
exclude_patterns:
- '*.log'
- '*.pyc'
- '*/.git'
- '*/.svn'
- '*/vendor/*'
- '*/node_modules/*'
exclude_caches: true
exclude_if_present: '.nobackup'
storage:
encryption_passphrase: '{{ borgbackup.passphrase }}'
retries: 1
retry_wait: 300
retention:
keep_daily: 7
keep_weekly: 8
keep_monthly: 12
keep_yearly: 30
consistency:
checks:
- repository
- archives
hooks:
before_backup:
- echo "`date` - Starting backup"
after_backup:
- echo "`date` - Finished backup"
on_error:
- /usr/local/bin/alertalerta.py{% if netdata_alerta_project_id is defined %} --pid={{ netdata_alerta_project_id }}{% endif %} {{ inventory_hostname }} {{ netdata_alerta_environment|default("production") }} {{ netdata_alerta_webhook }} {{ netdata_alerta_apikey }} '{"service":["https://www.borgbase.com"],"resource":"{{ inventory_hostname }}","event":"Borg {configuration_filename}","value":"{repository}","text":"Borg {configuration_filename}","rawData":"{output}"}'
one_file_system: true
exclude_patterns:
- '*.log'
- '*.pyc'
- '*/.git'
- '*/.svn'
- '*/vendor/*'
- '*/node_modules/*'
exclude_caches: true
exclude_if_present:
- '.nobackup'
encryption_passphrase: '{{ borgbackup.passphrase }}'
retries: 1
retry_wait: 300
keep_daily: 7
keep_weekly: 8
keep_monthly: 12
keep_yearly: 30
checks:
- name: repository
- name: archives
before_backup:
- echo "`date` - Starting backup"
after_backup:
- echo "`date` - Finished backup"
on_error:
- /usr/local/bin/alertalerta.py{% if netdata_alerta_project_id is defined %} --pid={{ netdata_alerta_project_id }}{% endif %} {{ inventory_hostname }} {{ netdata_alerta_environment|default("production") }} {{ netdata_alerta_webhook }} {{ netdata_alerta_apikey }} '{"service":["https://www.borgbase.com"],"resource":"{{ inventory_hostname }}","event":"Borg {configuration_filename}","value":"{repository}","text":"Borg {configuration_filename}","rawData":"{output}"}'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment