Fix backup chaining, optional dump database, and restore guard #1
Loading…
Reference in a new issue
No description provided.
Delete branch "review-repo-config-failing-actions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Tightens the backup and restore flow so archive names, incremental chaining, and restore behavior are consistent across the backup and entrypoint scripts.
Changes
compress_backupnow takes the full archive file name, so each backup type builds its own name. Full and incremental archives keep the<type>_<id>shape.get_latest_fullsearches the whole/backuptree for the newest full backup, not only today's directory. An incremental uses that full backup, even when it was taken on an earlier day. The incremental counter and name derive from the full backup's id, and the counter scans the same tree.MARIADB_DATABASEis now optional at startup and required only fordump, which fails with a clear message when it is unset. Dump file naming is computed once and reused.cleanup_restore_diruses${RESTORE_DIR:?}so an empty variable can never expand torm -rf /*.localdeclarations separated from assignment, which keeps exit codes from being masked.pipefailforRUNsteps and documents the one intentional hadolint exception./tmpis mounted as tmpfs because the scripts take their lock there and the root filesystem is read-only. The README describes the restore chain, the backup directory layout, and the dump scope.Why
rm -rfon a variable that could be empty./tmpfor the lock files.Testing
dumpfails fast withoutMARIADB_DATABASE, and full/incremental run without it./restoreholds only a dump file./tmp.