|
- @echo off
- rem SQLite backup and verification, run inside the "axonasp" container (the server keeps running).
- rem
- rem scripts\backup.cmd backup [file] consistent copy (VACUUM INTO) to db\backups\app-YYYYMMDD-HHMMSS.sqlite
- rem or [file], then integrity check and row-count comparison with the live db
- rem scripts\backup.cmd verify <file> integrity check, foreign keys, latest migration, row counts per table
- rem
- rem File names are relative to the repo root, for example db/backups/app-20261205-120000.sqlite.
- rem To restore, use scripts\restore.cmd <file>. The last line printed is "RESULT: ok" or "RESULT: failed".
- setlocal
- set CMD=%~1
- if "%CMD%"=="" set CMD=backup
- if /i "%CMD%"=="restore" (
- echo Use scripts\restore.cmd ^<file^>: it stops the server first.
- exit /b 1
- )
- docker exec -u axonasp -e SERVER_WEB_ROOT=/opt/axonasp/site -e "BACKUP_ACTION=%CMD%" -e "BACKUP_FILE=%~2" axonasp ./axonasp-cli -r /opt/axonasp/site/scripts/backup.asp
- exit /b %errorlevel%
|