diff --git a/README.md b/README.md index 5b2fd13..274a284 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,10 @@ `pobsync` is a pull-based backup service. It runs on a central backup server and pulls data from remote machines via rsync over SSH. -The current refactor is SQL-first: +The current refactor is Django-first and SQL-backed: -- Django is the management layer and source of truth. +- The Django control panel is the primary interface for setup and operations. +- The database is the source of truth for hosts, schedules, runs, snapshots, credentials, and retention settings. - SQLite is the default database; MariaDB is optional. - Backups use the existing rsync snapshot engine internally. - Scheduling is handled by a Django scheduler service, not host cron. @@ -159,6 +160,6 @@ systemctl status pobsync-web pobsync-worker pobsync-scheduler ## Development -Development, Docker, migration helper commands, and architecture notes live in: +Development, Docker, maintainer tooling, and architecture notes live in: - [docs/development.md](docs/development.md) diff --git a/docs/development.md b/docs/development.md index b1f4ef6..9162b99 100644 --- a/docs/development.md +++ b/docs/development.md @@ -34,58 +34,32 @@ docker compose build web scheduler worker docker compose run --rm web python manage.py test pobsync_backend --verbosity 2 ``` -## SQL-First Commands +## Maintainer CLI -The Django UI is the normal operating surface, but the `pobsync` entrypoint remains useful for setup and inspection. +The Django UI is the normal operating surface. The `pobsync` entrypoint and direct `manage.py` commands are kept for +debugging, automated maintenance, and migrations. Prefer using the control panel for day-to-day host configuration, +schedule changes, manual backup queueing, snapshot discovery, retention planning, and SSH credential management. -Create global config: - -``` -pobsync configure-global --backup-root /mnt/backups/pobsync -``` - -Create a host config: - -``` -pobsync configure-host --address -``` - -Run a backup: - -``` -pobsync backup --prune -``` - -Create or update a schedule: - -``` -pobsync schedule --cron "15 2 * * *" --prune -``` - -Run the scheduler: - -``` -pobsync scheduler --loop --interval 60 -``` - -Plan or apply retention manually: - -``` -pobsync retention -pobsync retention --apply --yes --max-delete 10 -``` - -Discover snapshots already present on disk: - -``` -pobsync discover-snapshots --host -``` - -The `pobsync` executable is a thin wrapper around Django management commands. Direct Django access is also available: +Useful checks: ``` pobsync django check -python3 manage.py run_pobsync_backup --prune +python3 manage.py showmigrations pobsync_backend +``` + +Worker and scheduler commands are normally run by systemd services: + +``` +pobsync worker --loop --interval 15 +pobsync scheduler --loop --interval 60 +``` + +One-off maintenance commands are still available when the UI is not the right tool: + +``` +pobsync backup --dry-run +pobsync discover-snapshots --host +pobsync retention ``` ## Migration Helpers @@ -102,7 +76,8 @@ Export SQL config to legacy runtime YAML for inspection or one-off compatibility python3 manage.py export_pobsync_configs --prefix /opt/pobsync ``` -These commands are migration helpers, not the normal operating model. +These commands are migration helpers, not the normal operating model. After import, review and continue operating from +the Django control panel. ## Docker With SQLite @@ -158,7 +133,8 @@ sudo scripts/install-systemd --install-extras mariadb ## Current Architecture -The public command surface is Django-first. The old YAML/cron CLI has been retired from the `pobsync` entrypoint. +The public operating surface is Django-first. The CLI is now a maintainer layer around Django management commands and +the old YAML/cron workflow has been retired from the `pobsync` entrypoint. Discovered snapshots are stored in `SnapshotRecord`, including the base snapshot metadata and a nullable SQL link to the base record when it is known.