2022-11-05 08:16:55

This commit is contained in:
2022-11-05 08:16:56 -04:00
parent f9a754b879
commit 8ab2afc6f2

View File

@@ -172,7 +172,7 @@ NEWPATH="$ARCHPATH$NEWDATE/$SUBDIR"
if [[ $FULLRESTORE == false ]]; then if [[ $FULLRESTORE == false ]]; then
OLDDATE=$(ls -1rt "$ARCHPATH" | head -1) OLDDATE=$(ls -1rt "$ARCHPATH" | head -1)
OLDPATH="$ARCHPATH$OLDDATE/$SUBDIR" OLDPATH="$ARCHPATH$OLDDATE/$SUBDIR"
echo "compartive restoration selected:\n\tfiles from:\t'$NEWDATE'\n\tcompared to:\t'$OLDDATE'" echo -e "compartive restoration selected:\n\tfiles from:\t'$NEWDATE'\n\tcompared to:\t'$OLDDATE'"
else else
echo "full restorion selected: comparisons will not be made, all non-excluded databases will be restored" echo "full restorion selected: comparisons will not be made, all non-excluded databases will be restored"
fi fi
@@ -181,8 +181,10 @@ echo "\nfinding files in '$NEWPATH*.gz'"
for FILE in $NEWPATH*.gz; do for FILE in $NEWPATH*.gz; do
if [[ "${SETPOSDB}" =~ ${FILE%%.*} ]]; then echo -e "\t-- recognized $FILE for master position and log file" if [[ "${SETPOSDB}" =~ ${FILE%%.*} ]]; then echo -e "\t-- recognized $FILE for master position and log file"
SETPOSFILE=$(realpath $FILE) SETPOSFILE=$(realpath $FILE)
echo -e "\tposition file: $SETPOSFILE" SETPOSSTMT=$(zcat $SETPOSFILE | head -40 | grep MASTER | sed 's/-- //')
fi; echo -e "\n$SETPOSSTMT\n"
exit
fi
FILE=$(basename $FILE) FILE=$(basename $FILE)
STARTLOOP=$(date +%s) STARTLOOP=$(date +%s)
@@ -220,9 +222,7 @@ else
echo "replication credentials not configured" echo "replication credentials not configured"
fi fi
if [[ -n $SETPOSFILE ]]; then if [[ -n $SETPOSSTMT ]]; then
SETPOSSTMT=$(zcat $SETPOSFILE | head -40 | grep MASTER | sed 's/-- //')
echo -e "\n$SETPOSSTMT\n"
$CMD mysql -e "$SETPOS" $CMD mysql -e "$SETPOS"
else else
DONOTSTART=true DONOTSTART=true