bash-stuff/backup-image/verify-all.sh

30 lines
571 B
Bash
Raw Permalink Normal View History

2024-08-30 13:16:28 +01:00
#/bin/bash
echo "Verify All Backups!";
2024-08-30 13:40:34 +01:00
if [[ "$1" == '$' ]]; then
2024-08-30 13:16:28 +01:00
echo "Usage: verify-all.sh [Storage disk root path]";
exit 2;
fi
ssrc="";
if [ -z $1 ]; then
ssrc="/mnt";
else
ssrc="$1";
fi
echo "Storage disk root path: $ssrc";
if [[ "$2" != "ikwid" ]]; then
echo "Press Enter to Start...";
read;
fi
rval=0;
for cf in $ssrc/tabls/*; do
if [ -e "$cf" ] && [ -f "$cf" ]; then
./verify.sh $(basename "$cf" ".tbl") "$ssrc" "ikwid";
if [ $? -ne 0 ]; then
echo "Verify failed: $cf";
rval=1;
fi
fi
done
echo "Finished!";
exit $rval;