Skip to content

Commit 7d7cb95

Browse files
committed
Release 3.3.2 - See CHANGELOG.md
1 parent d1713fe commit 7d7cb95

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 3.3.2 2022-05-02 <dave at tiredofit dot ca>
2+
3+
### Added
4+
- Add POST_SCRIPT_SKIP_X_VERIFY environment variables to allow for more host compatibility for post scripts
5+
6+
17
## 3.3.1 2022-04-30 <dave at tiredofit dot ca>
28

39
### Changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ Outputs the following on the console:
261261

262262
If you wish to change the size value from bytes to megabytes set environment variable `SIZE_VALUE=megabytes`
263263

264+
You must make your scripts executible otherwise there is an internal check that will skip trying to run it otherwise.
265+
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.
266+
264267
## Support
265268

266269
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.

install/assets/functions/10-db-backup

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -643,23 +643,31 @@ post_dbbackup() {
643643

644644
### Post Script Support
645645
if [ -n "${POST_SCRIPT}" ] ; then
646-
if [ -x "${POST_SCRIPT}" ] ; then
647-
print_notice "Found POST_SCRIPT environment variable. Executing '${POST_SCRIPT}"
646+
if var_true "${POST_SCRIPT_SKIP_X_VERIFY}" ; then
648647
eval "${POST_SCRIPT}" "${exit_code}" "${dbtype}" "${DB_HOST}" "${1}" "${dbbackup_start_time}" "${dbbackup_finish_time}" "${dbbackup_total_time}" "${target}" "${FILESIZE}" "${checksum_value}"
649648
else
650-
print_error "Can't execute POST_SCRIPT environment variable '${POST_SCRIPT}' as its filesystem bit is not executible!"
649+
if [ -x "${POST_SCRIPT}" ] ; then
650+
print_notice "Found POST_SCRIPT environment variable. Executing '${POST_SCRIPT}"
651+
eval "${POST_SCRIPT}" "${exit_code}" "${dbtype}" "${DB_HOST}" "${1}" "${dbbackup_start_time}" "${dbbackup_finish_time}" "${dbbackup_total_time}" "${target}" "${FILESIZE}" "${checksum_value}"
652+
else
653+
print_error "Can't execute POST_SCRIPT environment variable '${POST_SCRIPT}' as its filesystem bit is not executible!"
654+
fi
651655
fi
652656
fi
653657

654658
### Post Backup Custom Script Support
655659
if [ -d "/assets/custom-scripts/" ] ; then
656660
for f in $(find /assets/custom-scripts/ -name \*.sh -type f); do
657-
if [ -x "${f}" ] ; then
658-
print_notice "Executing post backup custom script : '${f}'"
659-
## script EXIT_CODE DB_TYPE DB_HOST DB_NAME STARTEPOCH FINISHEPOCH DURATIONEPOCH BACKUP_FILENAME FILESIZE CHECKSUMVALUE
661+
if var_true "${POST_SCRIPT_SKIP_X_VERIFY}" ; then
660662
${f} "${exit_code}" "${dbtype}" "${DB_HOST}" "${1}" "${dbbackup_start_time}" "${dbbackup_finish_time}" "${dbbackup_total_time}" "${target}" "${FILESIZE}" "${checksum_value}"
661663
else
662-
print_error "Can't run post backup custom script: '${f}' as its filesystem bit is not executible!"
664+
if [ -x "${f}" ] ; then
665+
print_notice "Executing post backup custom script : '${f}'"
666+
## script EXIT_CODE DB_TYPE DB_HOST DB_NAME STARTEPOCH FINISHEPOCH DURATIONEPOCH BACKUP_FILENAME FILESIZE CHECKSUMVALUE
667+
${f} "${exit_code}" "${dbtype}" "${DB_HOST}" "${1}" "${dbbackup_start_time}" "${dbbackup_finish_time}" "${dbbackup_total_time}" "${target}" "${FILESIZE}" "${checksum_value}"
668+
else
669+
print_error "Can't run post backup custom script: '${f}' as its filesystem bit is not executible!"
670+
fi
663671
fi
664672
done
665673
fi

0 commit comments

Comments
 (0)