ops: add production observability and recovery
This commit is contained in:
22
infra/scripts/verify-backup.sh
Normal file
22
infra/scripts/verify-backup.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user