api_version: iobackup.io/v1
kind: BackupJob

metadata:
  job_id: runtime-hooks-example
  name: Safe runtime_hooks (requires agent features.hooks)

spec:
  enabled: true
  operation:
    type: backup
    strategy: full
  repository:
    type: single_artifact
    engine: iobackup
  runtime_hooks:
    - alias: before_job
      command: ["true"]
      timeout: 5s
      on_nonzero_exit: warn_only
  tasks:
    - task_id: t1
      source:
        type: filesystem
        config:
          paths:
            - /etc/hosts
      destination:
        type: local
        config:
          path: /tmp/backups
      backup:
        format: tar.gz
        compression: gzip
        checksum: sha256
