From 7d7cb9587d1718bc37074d0abb084e0a7874723c Mon Sep 17 00:00:00 2001 From: Dave Conroy Date: Mon, 2 May 2022 22:28:08 -0700 Subject: [PATCH] Release 3.3.2 - See CHANGELOG.md --- CHANGELOG.md | 6 ++++++ README.md | 3 +++ install/assets/functions/10-db-backup | 22 +++++++++++++++------- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d2b935..636f748 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 3.3.2 2022-05-02 + + ### Added + - Add POST_SCRIPT_SKIP_X_VERIFY environment variables to allow for more host compatibility for post scripts + + ## 3.3.1 2022-04-30 ### Changed diff --git a/README.md b/README.md index 7485fd7..a6b7cb9 100644 --- a/README.md +++ b/README.md @@ -261,6 +261,9 @@ Outputs the following on the console: If you wish to change the size value from bytes to megabytes set environment variable `SIZE_VALUE=megabytes` +You must make your scripts executible otherwise there is an internal check that will skip trying to run it otherwise. +If for some reason your filesystem or host is not detecting it right, use the environment variable `POST_SCRIPT_SKIP_X_VERIFY=TRUE` to bypass. + ## Support These images were built to serve a specific need in a production environment and gradually have had more functionality added based on requests from the community. diff --git a/install/assets/functions/10-db-backup b/install/assets/functions/10-db-backup index 8b82783..fcd3db4 100755 --- a/install/assets/functions/10-db-backup +++ b/install/assets/functions/10-db-backup @@ -643,23 +643,31 @@ post_dbbackup() { ### Post Script Support if [ -n "${POST_SCRIPT}" ] ; then - if [ -x "${POST_SCRIPT}" ] ; then - print_notice "Found POST_SCRIPT environment variable. Executing '${POST_SCRIPT}" + if var_true "${POST_SCRIPT_SKIP_X_VERIFY}" ; then eval "${POST_SCRIPT}" "${exit_code}" "${dbtype}" "${DB_HOST}" "${1}" "${dbbackup_start_time}" "${dbbackup_finish_time}" "${dbbackup_total_time}" "${target}" "${FILESIZE}" "${checksum_value}" else - print_error "Can't execute POST_SCRIPT environment variable '${POST_SCRIPT}' as its filesystem bit is not executible!" + if [ -x "${POST_SCRIPT}" ] ; then + print_notice "Found POST_SCRIPT environment variable. Executing '${POST_SCRIPT}" + eval "${POST_SCRIPT}" "${exit_code}" "${dbtype}" "${DB_HOST}" "${1}" "${dbbackup_start_time}" "${dbbackup_finish_time}" "${dbbackup_total_time}" "${target}" "${FILESIZE}" "${checksum_value}" + else + print_error "Can't execute POST_SCRIPT environment variable '${POST_SCRIPT}' as its filesystem bit is not executible!" + fi fi fi ### Post Backup Custom Script Support if [ -d "/assets/custom-scripts/" ] ; then for f in $(find /assets/custom-scripts/ -name \*.sh -type f); do - if [ -x "${f}" ] ; then - print_notice "Executing post backup custom script : '${f}'" - ## script EXIT_CODE DB_TYPE DB_HOST DB_NAME STARTEPOCH FINISHEPOCH DURATIONEPOCH BACKUP_FILENAME FILESIZE CHECKSUMVALUE + if var_true "${POST_SCRIPT_SKIP_X_VERIFY}" ; then ${f} "${exit_code}" "${dbtype}" "${DB_HOST}" "${1}" "${dbbackup_start_time}" "${dbbackup_finish_time}" "${dbbackup_total_time}" "${target}" "${FILESIZE}" "${checksum_value}" else - print_error "Can't run post backup custom script: '${f}' as its filesystem bit is not executible!" + if [ -x "${f}" ] ; then + print_notice "Executing post backup custom script : '${f}'" + ## script EXIT_CODE DB_TYPE DB_HOST DB_NAME STARTEPOCH FINISHEPOCH DURATIONEPOCH BACKUP_FILENAME FILESIZE CHECKSUMVALUE + ${f} "${exit_code}" "${dbtype}" "${DB_HOST}" "${1}" "${dbbackup_start_time}" "${dbbackup_finish_time}" "${dbbackup_total_time}" "${target}" "${FILESIZE}" "${checksum_value}" + else + print_error "Can't run post backup custom script: '${f}' as its filesystem bit is not executible!" + fi fi done fi