2022-11-05 09:08:15
This commit is contained in:
@@ -45,7 +45,7 @@ while [[ $# -gt 0 ]]; do
|
|||||||
case $1 in
|
case $1 in
|
||||||
-d|--dry-run)
|
-d|--dry-run)
|
||||||
DRY_RUN=true
|
DRY_RUN=true
|
||||||
CMD='echo -e "\t$(tput setaf 3)EXECUTE: $(tput sgr 0)"'; echo
|
CMD="echo -e \t$(tput setaf 3)EXECUTE: $(tput sgr 0)"; echo
|
||||||
shift 1
|
shift 1
|
||||||
;;
|
;;
|
||||||
-a|--archive)
|
-a|--archive)
|
||||||
@@ -163,7 +163,7 @@ echo -e "\nrestoring"
|
|||||||
START=$(date +%s)
|
START=$(date +%s)
|
||||||
|
|
||||||
echo -e "\n--START: $(date +%F\ %T)\nrestoring most recent backups from $ARCHPATH"
|
echo -e "\n--START: $(date +%F\ %T)\nrestoring most recent backups from $ARCHPATH"
|
||||||
echo -e "\tstopping replication\n";
|
echo -e "\tstopping replication";
|
||||||
$CMD mysql -e "STOP SLAVE;"
|
$CMD mysql -e "STOP SLAVE;"
|
||||||
|
|
||||||
NEWDATE=$(ls -1r "$ARCHPATH" | head -1)
|
NEWDATE=$(ls -1r "$ARCHPATH" | head -1)
|
||||||
@@ -172,9 +172,9 @@ 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 -e "compartive restoration selected:\n\tfiles from:\t'$NEWDATE'\n\tcompared to:\t'$OLDDATE'"
|
echo -e "\n\ncompartive 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 "\n\nfull restorion selected: comparisons will not be made, all non-excluded databases will be restored"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\nfinding files in '$NEWPATH*.gz'"
|
echo -e "\nfinding files in '$NEWPATH*.gz'"
|
||||||
|
|||||||
Reference in New Issue
Block a user