Compare commits

..

No commits in common. "8315a5822650513d58fa86ece9c9f31ef3d60751" and "3d7fc0a3f6c689d8246bcac3899079beac52ae43" have entirely different histories.

View File

@ -23,21 +23,16 @@ backupVerifySnapshot()
return 1
fi
# The scratch restore above succeeding is the real proof the snapshot is
# restorable (restic verifies each blob's hash as it restores). We can't
# compare against the live app dir any more — the live path deliberately
# differs from the snapshot (raw DB dirs and private file trees are excluded
# and replaced by dumps/captures under .lp-backup) — so just sanity-check the
# restore produced a non-empty tree.
local restored_count
local source_count restored_count
source_count=$(sudo find "$containers_dir$app_name" -type f 2>/dev/null | wc -l)
restored_count=$(sudo find "$scratch$containers_dir$app_name" -type f 2>/dev/null | wc -l)
sudo rm -rf "$scratch"
if [[ "$restored_count" -lt 1 ]]; then
isError "Verify FAILED for $app_name — restored snapshot is empty"
if [[ "$source_count" -ne "$restored_count" ]]; then
isError "Verify file-count mismatch for $app_name (source=$source_count restored=$restored_count)"
return 1
fi
isSuccessful "Snapshot ${snapshot_id:0:8} verified — restored $restored_count files"
isSuccessful "Snapshot ${snapshot_id:0:8} verified — file count matches ($source_count)"
}