api_version: iobackup.io/v1
kind: BackupJob
metadata:
  job_id: clickhouse-local
  name: ClickHouse backup to local destination
spec:
  enabled: true
  operation:
    type: backup
  artifact:
    mode: stream
    staging:
      enabled: false
  policies:
    verify:
      after_run: true
      limit_per_task: 1
  tasks:
    - task_id: clickhouse-main
      source:
        type: clickhouse
        config:
          host: 127.0.0.1
          port: 18123
          username: default
          databases:
            - iobackup
          timeout: 30s
      backup:
        format: jsonl
        checksum: sha256
      destination:
        type: local
        config:
          path: /add/tmp/backups-clickhouse
      policies:
        retention:
          keep_last_successful: 3
