1.5 KiB
1.5 KiB
Backup Orchestrator Server
Backend orchestrator for the Windows-to-Proxmox rsync pull pipeline.
Structure
app/config.py: settings derived from.envand helpers for backup/current/history/log directories.app/models.py: SQLModel schema for jobs, profiles, tokens and retention history.app/database.py: SQLite engine and helpers.app/job_runner.py: threaded job queue that executesrsyncover SSH, streams logs, updates job status, and enforces 20-run retention.app/main.py: FastAPI application exposing auth, profile CRUD, backup start/status/log, and health.
Getting started
- Copy
.env.exampleto.envand adjust values (especiallyDATABASE_URL,BACKUP_BASE, and credentials). - Create Python environment and install dependencies (e.g.
pip install .orhatch run pip install .). - Start the API/runner:
uvicorn app.main:app --host 0.0.0.0 --port 8443 - Ensure
/srv/backup/currentand/srv/backup/.historyare writable by the service user. - Install
sshpassandrsyncon the Proxmox VM; the runner relies on them to pull from Windows.
Notes
- Tokens live in the database for
TOKEN_LIFETIME_MINUTES; expired tokens return 401. - Each backup run writes to
<log_dir>/job_<id>.log; status endpoints return the last lines. - History retention keeps the 20 most recent runs per profile and prunes older directories under
/srv/backup/.history. - The job runner expects the client to expose OpenSSH on port 22;
sshpassis used to handpass the provided password.