[buildout]
extends =
    ${instance-mariadb:output}

parts =
  url
  mariadb
  duplicity
  stunnel
  certificate-authority
  logrotate
  logrotate-entry-mariadb
  cron
  cron-entry-logrotate
  cron-entry-mariadb-backup
  cron-entry-duplicity

[duplicity]
recipe = slapos.cookbook:duplicity
remote_backup = $${slap-parameter:remote-backup}
directory = $${mariadb:backup-directory}
duplicity_binary = ${buildout:bin-directory}/duplicity
wrapper = $${rootdirectory:bin}/duplicity
recover = false

[cron-entry-duplicity]
<= cron
recipe = slapos.cookbook:cron.d
name = mariadb_remotebackup
frequency = 0 1 * * *
command = $${duplicity:wrapper}
