2022-11-04 20:22:07
This commit is contained in:
@@ -1,18 +1,44 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- ---#
|
||||||
|
## script was written with daily, dated, backups from holland backup #
|
||||||
|
## mysqldump per table in directories with date/time like
|
||||||
|
## /backups/daily/20221104_65127/backup_data/database-name.sql.gz
|
||||||
|
##
|
||||||
|
|
||||||
|
### path to archive directory. e.g., /home/backupusr/backups/daily/
|
||||||
ARCHPATH='/path/to/backup/daily/'
|
ARCHPATH='/path/to/backup/daily/'
|
||||||
|
|
||||||
|
### sudirectory from date. e.g., /backup_data/
|
||||||
SUBDIR='backup_data'
|
SUBDIR='backup_data'
|
||||||
|
|
||||||
|
### databases to skip. e.g., mysql
|
||||||
SKIPDBS=('mysql')
|
SKIPDBS=('mysql')
|
||||||
|
|
||||||
|
### restore only changed databases or restore all
|
||||||
FULLRESTORE=false
|
FULLRESTORE=false
|
||||||
|
|
||||||
|
### database to use for master log position
|
||||||
SETPOSDB=db_for_master_log_position
|
SETPOSDB=db_for_master_log_position
|
||||||
|
|
||||||
|
### config file for mysql credentials
|
||||||
CFG='~/.my.cnf'
|
CFG='~/.my.cnf'
|
||||||
|
|
||||||
|
### dry-run will show actions for testing
|
||||||
DRY_RUN=false
|
DRY_RUN=false
|
||||||
|
|
||||||
|
### noprompt for skipping user input
|
||||||
NOPROMPT=false
|
NOPROMPT=false
|
||||||
|
|
||||||
|
### do not start will not restart replication when complete
|
||||||
DONOTSTART=false
|
DONOTSTART=false
|
||||||
CMD=''
|
|
||||||
|
### values for configuring replication master
|
||||||
MASTER_HOST=''
|
MASTER_HOST=''
|
||||||
MASTER_USER=''
|
MASTER_USER=''
|
||||||
MASTER_PASSWORD=''
|
MASTER_PASSWORD=''
|
||||||
#--- --- --- --- --- --- ---#
|
|
||||||
|
# #
|
||||||
|
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- ---#
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
@@ -66,7 +92,7 @@ while [[ $# -gt 0 ]]; do
|
|||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
echo -e "\n\n\t ______________________________ MySQL restoration script options ____________________________________\n"
|
echo -e "\n\n\t _____________________________/‾‾‾ MySQL restoration script options ‾‾‾\____________________________________\n"
|
||||||
echo -e "\t | arg | | type | default |\n"
|
echo -e "\t | arg | | type | default |\n"
|
||||||
echo -e "\t ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾"
|
echo -e "\t ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾"
|
||||||
echo -e "\t -h| --help display this menu [ flag ]"
|
echo -e "\t -h| --help display this menu [ flag ]"
|
||||||
|
|||||||
Reference in New Issue
Block a user