[Unit] Description=Daily backup of ops_dashboard database After=network.target ops-agent.service [Service] Type=oneshot User=ops-agent Group=ops-agent # Reads the shared secret and POSTs to ops-agent to trigger the backup flow. # ops-agent must be running and backup_ops_db.yml must be installed in /etc/ops-agent/flows/. ExecStart=/usr/bin/bash -c '\ SECRET=$(cat /etc/ops-agent/secret); \ curl -sf -X POST http://127.0.0.1:3099/agent/v1/flow \ -H "Authorization: Bearer $SECRET" \ -H "Content-Type: application/json" \ -d "{\"flow_key\":\"backup_ops_db\"}" \ ' StandardOutput=journal StandardError=journal SyslogIdentifier=ops-db-backup