mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-22 13:44:08 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f58cfd284 | ||
|
|
2d01f5e692 | ||
|
|
dbd0a03b0d | ||
|
|
6527f4ff63 |
@@ -1,3 +1,11 @@
|
||||
## 3.1.3 2022-03-30 <dave at tiredofit dot ca>
|
||||
|
||||
### Changed
|
||||
- Fix for MariaDB not sending database name to post script
|
||||
- Check for executible bit on post scripts both via environment variable and /assets/custom
|
||||
- SPLIT_DB defaulted to TRUE
|
||||
|
||||
|
||||
## 3.1.2 2022-03-29 <dave at tiredofit dot ca>
|
||||
|
||||
### Changed
|
||||
|
||||
@@ -18,7 +18,7 @@ PARALLEL_COMPRESSION_THREADS=${PARALLEL_COMPRESSION_THREADS:-"$(nproc)"}
|
||||
S3_CERT_SKIP_VERIFY=${S3_CERT_SKIP_VERIFY:-"TRUE"}
|
||||
S3_PROTOCOL=${S3_PROTOCOL:-"https"}
|
||||
SIZE_VALUE=${SIZE_VALUE:-"bytes"}
|
||||
SPLIT_DB=${SPLIT_DB:-"FALSE"}
|
||||
SPLIT_DB=${SPLIT_DB:-"TRUE"}
|
||||
TEMP_LOCATION=${TEMP_LOCATION:-"/tmp/backups"}
|
||||
dbhost=${DB_HOST}
|
||||
dbname=${DB_NAME}
|
||||
|
||||
@@ -176,7 +176,7 @@ backup_mysql() {
|
||||
check_exit_code $target
|
||||
generate_checksum
|
||||
move_dbbackup
|
||||
post_dbbackup
|
||||
post_dbbackup $db
|
||||
done
|
||||
else
|
||||
print_debug "Not splitting database dumps into their own files"
|
||||
@@ -543,17 +543,24 @@ 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}"
|
||||
eval "${POST_SCRIPT}" "${exit_code}" "${dbtype}" "${dbhost}" "${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
|
||||
|
||||
### Post Backup Custom Script Support
|
||||
if [ -d "/assets/custom-scripts/" ] ; then
|
||||
print_notice "Found Post Backup Custom Script to execute"
|
||||
for f in $(find /assets/custom-scripts/ -name \*.sh -type f); do
|
||||
print_notice "Running Script: '${f}'"
|
||||
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}" "${dbhost}" "${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
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user