# Restorly configuration. Changes made in the panel rewrite this file; # comments and key order are not kept. Hand edits are fine: the panel reads them. agent: network: offline state_dir: /var/lib/restorly-example locations: - id: nas type: local role: source path: /mnt/nas/backups targets: - id: webshop engine: mariadb location: nas path: webshop pattern: webshop-{YYYY}-{MM}-{DD}_{hh}{mm}.sql.gz max_age: 26h schedule: 0 4 * * * checks: custom: - id: recent-orders sql: SELECT TIMESTAMPDIFF(HOUR, MAX(created_at), NOW()) FROM orders expect: op: <= value: 24 - id: customers-not-empty sql: SELECT COUNT(*) FROM customers expect: op: '>' value: 1000 - id: orders-have-customers sql: SELECT COUNT(*) FROM orders o LEFT JOIN customers c ON c.id = o.customer_id WHERE c.id IS NULL expect: op: = value: 0 - id: crm engine: postgres location: nas path: crm pattern: crm-{YYYY}{MM}{DD}.dump max_age: 26h schedule: 0 4 * * * checks: custom: - id: app-settings sql: SELECT COUNT(*) FROM app_settings WHERE key IN ('base_url', 'smtp_host', 'default_currency') expect: op: = value: 3 - id: deals-have-accounts sql: SELECT COUNT(*) FROM deals d LEFT JOIN accounts a ON a.id = d.account_id WHERE a.id IS NULL expect: op: = value: 0 - id: billing engine: postgres location: nas path: billing pattern: billing-{YYYY}{MM}{DD}.dump max_age: 26h schedule: 0 4 * * * checks: custom: - id: schema-version sql: SELECT version FROM schema_migrations WHERE NOT dirty expect: op: '>=' value: 85 - id: invoices-add-up sql: SELECT COUNT(*) FROM invoices i WHERE i.total <> (SELECT COALESCE(SUM(l.amount), 0) FROM invoice_lines l WHERE l.invoice_id = i.id) expect: op: = value: 0 - id: inventory engine: mysql location: nas path: inventory pattern: inventory-{YYYY}-{MM}-{DD}.sql.zst max_age: 26h schedule: 0 4 * * * checks: custom: - id: no-negative-stock sql: SELECT COUNT(*) FROM stock WHERE quantity < 0 expect: op: = value: 0 - id: products-have-prices sql: SELECT COUNT(*) FROM products WHERE price IS NULL expect: op: = value: 0