From 453107ad5668924f85bf96b912fc1040bf226d82 Mon Sep 17 00:00:00 2001 From: gnolong <2391353625@qq.com> Date: Mon, 6 Jan 2025 15:16:46 +0800 Subject: [PATCH] based on comment --- .../dataprotection/xtrabackup-incremental-backup.sh | 3 ++- .../dataprotection/xtrabackup-incremental-restore.sh | 4 ++-- addons/mysql/dataprotection/xtrabackup-incremental-backup.sh | 3 ++- addons/mysql/dataprotection/xtrabackup-incremental-restore.sh | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/addons/apecloud-mysql/dataprotection/xtrabackup-incremental-backup.sh b/addons/apecloud-mysql/dataprotection/xtrabackup-incremental-backup.sh index ca86303ed..5a15800fd 100644 --- a/addons/apecloud-mysql/dataprotection/xtrabackup-incremental-backup.sh +++ b/addons/apecloud-mysql/dataprotection/xtrabackup-incremental-backup.sh @@ -24,7 +24,8 @@ fi # 2. get parent backup mkdir -p ${DATA_DIR} -PARENT_DIR=${DATA_MOUNT_DIR}/parent +PARENT_DIR=${DATA_MOUNT_DIR}/xtrabackup-parent +rm -rf ${PARENT_DIR} mkdir -p ${PARENT_DIR} && cd ${PARENT_DIR} # set the datasafed backend base path for the parent backup export DATASAFED_BACKEND_BASE_PATH="${DP_BACKUP_ROOT_PATH}/${DP_PARENT_BACKUP_NAME}/${DP_TARGET_RELATIVE_PATH}" diff --git a/addons/apecloud-mysql/dataprotection/xtrabackup-incremental-restore.sh b/addons/apecloud-mysql/dataprotection/xtrabackup-incremental-restore.sh index 64f05f0c1..bbcdc7bc1 100644 --- a/addons/apecloud-mysql/dataprotection/xtrabackup-incremental-restore.sh +++ b/addons/apecloud-mysql/dataprotection/xtrabackup-incremental-restore.sh @@ -28,13 +28,13 @@ fi # 2. download backup files # download base backup file mkdir -p ${DATA_DIR} -BASE_DIR=${DATA_MOUNT_DIR}/base +BASE_DIR=${DATA_MOUNT_DIR}/xtrabackup-base download_backup_file "${DP_BASE_BACKUP_NAME}" "${BASE_DIR}" # download parent backup files if [ -n "${DP_ANCESTOR_INCREMENTAL_BACKUP_NAMES}" ]; then read -r -a ANCESTOR_INCREMENTAL_BACKUP_NAMES <<< "${DP_ANCESTOR_INCREMENTAL_BACKUP_NAMES//,/ }" fi -INCS_DIR=${DATA_MOUNT_DIR}/incs +INCS_DIR=${DATA_MOUNT_DIR}/xtrabackup-incs mkdir -p ${INCS_DIR} for parent_name in "${ANCESTOR_INCREMENTAL_BACKUP_NAMES[@]}"; do download_backup_file "${parent_name}" "${INCS_DIR}/${parent_name}" diff --git a/addons/mysql/dataprotection/xtrabackup-incremental-backup.sh b/addons/mysql/dataprotection/xtrabackup-incremental-backup.sh index 084266bfa..e0003fb6b 100644 --- a/addons/mysql/dataprotection/xtrabackup-incremental-backup.sh +++ b/addons/mysql/dataprotection/xtrabackup-incremental-backup.sh @@ -24,7 +24,8 @@ fi # 2. get parent backup mkdir -p ${DATA_DIR} -PARENT_DIR=${DATA_MOUNT_DIR}/parent +PARENT_DIR=${MYSQL_DIR}/xtrabackup-parent +rm -rf ${PARENT_DIR} mkdir -p ${PARENT_DIR} && cd ${PARENT_DIR} # set the datasafed backend base path for the parent backup export DATASAFED_BACKEND_BASE_PATH="${DP_BACKUP_ROOT_PATH}/${DP_PARENT_BACKUP_NAME}/${DP_TARGET_RELATIVE_PATH}" diff --git a/addons/mysql/dataprotection/xtrabackup-incremental-restore.sh b/addons/mysql/dataprotection/xtrabackup-incremental-restore.sh index d2ca33a03..f42b5a17c 100644 --- a/addons/mysql/dataprotection/xtrabackup-incremental-restore.sh +++ b/addons/mysql/dataprotection/xtrabackup-incremental-restore.sh @@ -33,13 +33,13 @@ fi # 2. download backup files # download base backup file mkdir -p ${DATA_DIR} -BASE_DIR=${DATA_MOUNT_DIR}/base +BASE_DIR=${MYSQL_DIR}/xtrabackup-base download_backup_file "${DP_BASE_BACKUP_NAME}" "${BASE_DIR}" # download parent backup files if [ -n "${DP_ANCESTOR_INCREMENTAL_BACKUP_NAMES}" ]; then read -r -a ANCESTOR_INCREMENTAL_BACKUP_NAMES <<< "${DP_ANCESTOR_INCREMENTAL_BACKUP_NAMES//,/ }" fi -INCS_DIR=${DATA_MOUNT_DIR}/incs +INCS_DIR=${MYSQL_DIR}/xtrabackup-incs mkdir -p ${INCS_DIR} for parent_name in "${ANCESTOR_INCREMENTAL_BACKUP_NAMES[@]}"; do download_backup_file "${parent_name}" "${INCS_DIR}/${parent_name}"