Files
ai-ticket-platform/infra/scripts/verify-backup.sh

23 lines
408 B
Bash

#!/bin/sh
set -eu
if [ "$#" -ne 1 ]; then
echo "用法:$0 <backup-directory>" >&2
exit 2
fi
TARGET=$(CDPATH= cd -- "$1" && pwd)
for file in SHA256SUMS postgres.dump postgres.contents minio-data.tar.gz manifest.txt; do
if [ ! -f "$TARGET/$file" ]; then
echo "备份缺少文件:$file" >&2
exit 3
fi
done
(
cd "$TARGET"
sha256sum -c SHA256SUMS
)
echo "备份校验通过:$TARGET"