Update mysqlbu-scripts.sh
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
action="$1"
|
action="$1"
|
||||||
FOLDER='/opt/idssys/mysqlbu'
|
FOLDER='/opt/idssys/mysqlbu'
|
||||||
VERS='2.10-06082025'
|
VERS='2.12-06082025'
|
||||||
|
|
||||||
source /opt/idssys/defaults/colors.inc
|
source /opt/idssys/defaults/colors.inc
|
||||||
source /opt/idssys/defaults/default.inc
|
source /opt/idssys/defaults/default.inc
|
||||||
@@ -20,7 +20,7 @@ MYSQLDATA="`grep --perl-regexp --only-match '(?<=datadir=).+' "$MYSQLCFG"`"
|
|||||||
DAY_BACKUP_DIR="${BACKUP_PATH}/`date +%Y-%m-%d`/"
|
DAY_BACKUP_DIR="${BACKUP_PATH}/`date +%Y-%m-%d`/"
|
||||||
[ ! -d $DAY_BACKUP_DIR ] && mkdir -p $DAY_BACKUP_DIR
|
[ ! -d $DAY_BACKUP_DIR ] && mkdir -p $DAY_BACKUP_DIR
|
||||||
BASE_BACKUP="`ls -1 $DAY_BACKUP_DIR 2> /dev/null | grep --max-count=1 --perl-regexp '^.+_BASE'`"
|
BASE_BACKUP="`ls -1 $DAY_BACKUP_DIR 2> /dev/null | grep --max-count=1 --perl-regexp '^.+_BASE'`"
|
||||||
LATEST_BACKUP="`ls -1t $DAY_BACKUP_DIR | grep --max-count=1 --perl-regexp '^.+-'`"
|
# LATEST_BACKUP="`ls -1t $DAY_BACKUP_DIR | grep --max-count=1 --perl-regexp '^.+-'`"
|
||||||
|
|
||||||
LIST_BACKUPS(){
|
LIST_BACKUPS(){
|
||||||
mysqlbu list
|
mysqlbu list
|
||||||
@@ -232,8 +232,8 @@ case $1 in
|
|||||||
/usr/local/bin/mysqlbu mysqldump
|
/usr/local/bin/mysqlbu mysqldump
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LATEST_BACKUP="`ls -1t $DAY_BACKUP_DIR | grep --max-count=1 --perl-regexp '^.+-'`"
|
# LATEST_BACKUP="`ls -1t $DAY_BACKUP_DIR | grep --max-count=1 --perl-regexp '^.+-'`"
|
||||||
ln -sfn ${DAY_BACKUP_DIR/${BACKUP_PATH}/.}${LATEST_BACKUP} ${BACKUP_PATH}/latest
|
# ln -sfn ${DAY_BACKUP_DIR/${BACKUP_PATH}/.}${LATEST_BACKUP} ${BACKUP_PATH}/latest
|
||||||
|
|
||||||
allfiles=`ls -1 ${BACKUP_PATH}`
|
allfiles=`ls -1 ${BACKUP_PATH}`
|
||||||
files=(`ls -1 ${BACKUP_PATH} | tail -$((${BACKUPSTOKEEP}+2))`)
|
files=(`ls -1 ${BACKUP_PATH} | tail -$((${BACKUPSTOKEEP}+2))`)
|
||||||
|
|||||||
Reference in New Issue
Block a user