| Server IP : 152.69.216.235 / Your IP : 80.80.80.28 Web Server : Apache/2.4.37 (Oracle Linux Server) System : Linux ust-wp4-prod 5.15.0-310.184.5.2.el8uek.x86_64 #2 SMP Wed Jul 9 16:08:33 PDT 2025 x86_64 User : apache ( 48) PHP Version : 8.4.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /bin/ |
Upload File : |
#!/bin/bash
# === CONFIGURATION ===
HOST=80.80.81.111
PORT=3306
USER="root"
PASSWORD="Root%40ust-mysql1-prod4WordPress" # WARNING: Consider using a .mylogin.cnf or prompt instead
## SUCCESS: with static dump directory
#mysqlsh --uri "$USER:$PASSWORD@$HOST:$PORT" --js -e '
#util.loadDump("/backup/www.ust-wp1-prod.20250620_230001", {
# schema: "www",
# threads: 4,
# showProgress: true
#});
#'
## SUCCESS: with read parameter
# Prompt user for dump path
echo "====================================================================="
echo "DROP ALL TABLES ON JOURNALS SCHEMA FIRST BEFORE RUNNING RESTORE!"
echo "====================================================================="
read -rp "ENTER THE FULL PATH TO THE DUMP DIRECTORY: " DUMP_DIR
mysqlsh --uri "$USER:$PASSWORD@$HOST:$PORT" --js -e "
util.loadDump(\"$DUMP_DIR\", {
schema: \"journals\",
threads: 4,
showProgress: true,
resetProgress: true
});
"
# === OPTIONAL: VERIFY BACKUP ===
if [ $? -eq 0 ]; then
echo "Restore completed successfully."
else
echo "Restore failed." >&2
exit 1
fi