2022-11-05 08:27:27

This commit is contained in:
2022-11-05 08:27:27 -04:00
parent 9b94a6fd76
commit 317257264a

View File

@@ -177,21 +177,18 @@ else
echo "full restorion selected: comparisons will not be made, all non-excluded databases will be restored"
fi
echo "\nfinding files in '$NEWPATH*.gz'"
echo -e "\nfinding files in '$NEWPATH*.gz'"
for FILE in $NEWPATH*.gz; do
STARTLOOP=$(date +%s)
FILE=$(basename $FILE)
echo -e "\n$(date +%F\ %T) | $FILE:"
if [[ "${SETPOSDB}" =~ ${FILE%%.*} ]]; then echo -e "\t-- recognized $FILE for master position and log file"
SETPOSFILE=$(realpath $FILE)
if [[ "${SETPOSDB}" =~ ${FILE%%.*} ]]; then echo -e "\t-- recognized '$FILE' for master position and log file"
SETPOSFILE=$NEWPATH$FILE
SETPOSSTMT=$(zcat $SETPOSFILE | head -40 | grep MASTER | sed 's/-- //')
echo -e "\n$SETPOSSTMT\n"
exit 2
echo -e "\t$SETPOSSTMT"
fi
exit 1
if [[ "${SKIPDBS[*]}" =~ ${FILE%%.*} ]]; then echo -e "\t-- skipping $FILE";continue; fi;
if [[ FULLRESTORE == false ]]; then
@@ -216,18 +213,18 @@ for FILE in $NEWPATH*.gz; do
printf '\t%02dh:%02dm:%02ds\n' $((EXCTIME/3600)) $((EXCTIME%3600/60)) $((EXCTIME%60))
done
if [[ -n MASTER_HOST ]] && [[ -n MASTER_USER ]] && [[ -n MASTER_PASSWORD ]]; then
echo -e "applying configuration for replication\n\thost: $MASTER_HOST\n\tuser: $MASTER_USER"
if [[ $MASTER_HOST && $MASTER_USER && $MASTER_PASSWORD ]]; then
echo -e "\napplying configuration for replication\n\thost: $MASTER_HOST\n\tuser: $MASTER_USER"
$CMD mysql -e "CHANGE MASTER TO master_host='$MASTER_HOST',master_user='$MASTER_USER',master_password='$MASTER_PASSWORD';"
else
echo "replication credentials not configured"
echo "\nreplication credentials not configured"
fi
if [[ -n $SETPOSSTMT ]]; then
$CMD mysql -e "$SETPOS"
if [[ $SETPOSSTMT ]]; then
$CMD mysql -e "$SETPOSSTMT"
else
DONOTSTART=true
echo "master position database undefined, listing suggestions"
echo "\nmaster position database undefined, listing suggestions"
for FILE in $NEWPATH*.gz; do
echo $(basename $FILE)
echo -e "\t$(zcat $FILE | head -40 | grep MASTER)"