Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
location:
source_directories:
- /mnt/source
repositories:
- /mnt/borg-repository
{% if backup.remoterepo|default(0) %}
- {{ backup.remoterepo }}
{% endif %}
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
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-'
consistency:
checks:
- repository
- archives
check_last: 3
prefix: 'backup-'
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"
{% if alerta is defined %}
- 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 %}