Skip to content
Snippets Groups Projects
config.yaml.twig 1.44 KiB
Newer Older
  • Learn to ignore specific revisions
  • source_directories:
      - /mnt/source
    repositories:
      - path: /mnt/borg-repository
        label: local
    
    jurgenhaas's avatar
    jurgenhaas committed
    {% if backup.remoterepo|default(0) %}
    
      - path: {{ backup.remoterepo }}
        label: remote
    
    jurgenhaas's avatar
    jurgenhaas committed
    {% endif %}
    
    one_file_system: true
    exclude_patterns:
      - '*.log'
      - '*.pyc'
      - '*/.git'
      - '*/.svn'
      - '*/vendor/*'
      - '*/node_modules/*'
    exclude_caches: true
    exclude_if_present:
      - '.nobackup'
    
    jurgenhaas's avatar
    jurgenhaas committed
    
    
    #   Passphase is set in varibable $BORG_PASSPHRASE
    #   encryption_passphrase: "DonNotMissToChangeYourPassphrase"
    compression: lz4
    archive_name_format: 'backup-{now}'
    retries: 3
    retry_wait: 300
    
    jurgenhaas's avatar
    jurgenhaas committed
    
    
    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-'
    
    jurgenhaas's avatar
    jurgenhaas committed
    
    
    checks:
      - name: repository
      - name: archives
    check_last: 3
    
    jurgenhaas's avatar
    jurgenhaas committed
    
    
    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"
    
    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) }}