Compare commits

...

4 Commits

Author SHA1 Message Date
dave@tiredofit.ca
be619fb707 Release 4.0.24 - See CHANGELOG.md 2023-11-28 15:06:50 -08:00
dave@tiredofit.ca
cccc088b35 Release 4.0.23 - See CHANGELOG.md 2023-11-28 08:05:11 -08:00
dave@tiredofit.ca
4579f4057c Release 4.0.22 - See CHANGELOG.md 2023-11-25 08:50:25 -08:00
dave@tiredofit.ca
cd683648d0 Release 4.0.21 - See CHANGELOG.md 2023-11-22 15:40:38 -08:00
3 changed files with 48 additions and 12 deletions

View File

@@ -1,3 +1,27 @@
## 4.0.24 2023-11-28 <dave at tiredofit dot ca>
### Changed
- Fix issue with cron parsing and 0 being a value getting clobbered by sort command
## 4.0.23 2023-11-28 <dave at tiredofit dot ca>
### Changed
- Resolve issue with custom notification scripts not executing
## 4.0.22 2023-11-25 <dave at tiredofit dot ca>
### Changed
- Move cleanup_old_data routines to happen within backup_ function to properly accomodate for globals, and ALL DB_NAME use cases
## 4.0.21 2023-11-22 <dave at tiredofit dot ca>
### Changed
- Fix for SQLite backups not being cleaned up properly due to a malformed base
## 4.0.20 2023-11-21 <dave at tiredofit dot ca> ## 4.0.20 2023-11-21 <dave at tiredofit dot ca>
### Changed ### Changed

View File

@@ -90,7 +90,6 @@ while true; do
fi fi
symlink_log symlink_log
cleanup_old_data
if var_false "${persist}" ; then if var_false "${persist}" ; then
print_debug "Exiting due to manual mode" print_debug "Exiting due to manual mode"

View File

@@ -482,6 +482,7 @@ backup_couch() {
move_dbbackup move_dbbackup
check_exit_code move "${backup_job_filename}" check_exit_code move "${backup_job_filename}"
post_dbbackup ${backup_job_db_name} post_dbbackup ${backup_job_db_name}
cleanup_old_data
} }
backup_influx() { backup_influx() {
@@ -522,6 +523,7 @@ backup_influx() {
move_dbbackup move_dbbackup
check_exit_code move "${backup_job_filename_dir}" check_exit_code move "${backup_job_filename_dir}"
post_dbbackup "${db}" post_dbbackup "${db}"
cleanup_old_data
done done
;; ;;
2 ) 2 )
@@ -550,6 +552,7 @@ backup_influx() {
move_dbbackup move_dbbackup
check_exit_code move "${backup_job_filename_dir}" check_exit_code move "${backup_job_filename_dir}"
post_dbbackup "${db}" post_dbbackup "${db}"
cleanup_old_data
done done
;; ;;
esac esac
@@ -586,6 +589,7 @@ backup_mongo() {
move_dbbackup move_dbbackup
check_exit_code move "${backup_job_filename}" check_exit_code move "${backup_job_filename}"
post_dbbackup "${backup_job_db_name}" post_dbbackup "${backup_job_db_name}"
cleanup_old_data
if var_true "${DEBUG_BACKUP_MONGO}" ; then debug off; fi if var_true "${DEBUG_BACKUP_MONGO}" ; then debug off; fi
} }
@@ -614,6 +618,7 @@ backup_mssql() {
move_dbbackup move_dbbackup
check_exit_code move "${backup_job_filename}" check_exit_code move "${backup_job_filename}"
post_dbbackup "${backup_job_db_name}" post_dbbackup "${backup_job_db_name}"
cleanup_old_data
;; ;;
trn|transaction ) trn|transaction )
prepare_dbbackup prepare_dbbackup
@@ -636,6 +641,7 @@ backup_mssql() {
move_dbbackup move_dbbackup
check_exit_code move "${backup_job_filename}" check_exit_code move "${backup_job_filename}"
post_dbbackup "${backup_job_db_name}" post_dbbackup "${backup_job_db_name}"
cleanup_old_data
;; ;;
esac esac
} }
@@ -687,6 +693,7 @@ backup_mysql() {
move_dbbackup move_dbbackup
check_exit_code move "${backup_job_filename}" check_exit_code move "${backup_job_filename}"
post_dbbackup "${db}" post_dbbackup "${db}"
cleanup_old_data
done done
else else
write_log debug "Not splitting database dumps into their own files" write_log debug "Not splitting database dumps into their own files"
@@ -707,6 +714,7 @@ backup_mysql() {
move_dbbackup move_dbbackup
check_exit_code move "${backup_job_filename}" check_exit_code move "${backup_job_filename}"
post_dbbackup all post_dbbackup all
cleanup_old_data
fi fi
} }
@@ -728,6 +736,7 @@ backup_pgsql() {
move_dbbackup move_dbbackup
check_exit_code move "${backup_job_filename}" check_exit_code move "${backup_job_filename}"
post_dbbackup "globals" post_dbbackup "globals"
cleanup_old_data
} }
if var_true "${DEBUG_BACKUP_PGSQL}" ; then debug on; fi if var_true "${DEBUG_BACKUP_PGSQL}" ; then debug on; fi
@@ -776,6 +785,7 @@ backup_pgsql() {
move_dbbackup move_dbbackup
check_exit_code move "${backup_job_filename}" check_exit_code move "${backup_job_filename}"
post_dbbackup "${db}" post_dbbackup "${db}"
cleanup_old_data
done done
if var_true "${_postgres_backup_globals}" ; then backup_pgsql_globals; fi if var_true "${_postgres_backup_globals}" ; then backup_pgsql_globals; fi
else else
@@ -805,6 +815,7 @@ backup_pgsql() {
move_dbbackup move_dbbackup
check_exit_code move "${backup_job_filename}" check_exit_code move "${backup_job_filename}"
post_dbbackup all post_dbbackup all
cleanup_old_data
if var_true "${_postgres_backup_globals}" ; then backup_pgsql_globals; fi if var_true "${_postgres_backup_globals}" ; then backup_pgsql_globals; fi
fi fi
} }
@@ -844,6 +855,7 @@ backup_redis() {
move_dbbackup move_dbbackup
check_exit_code move "${backup_job_filename}" check_exit_code move "${backup_job_filename}"
post_dbbackup all post_dbbackup all
cleanup_old_data
} }
backup_sqlite3() { backup_sqlite3() {
@@ -851,7 +863,7 @@ backup_sqlite3() {
db=$(basename "${backup_job_db_host}") db=$(basename "${backup_job_db_host}")
db="${db%.*}" db="${db%.*}"
backup_job_filename=sqlite3_${db}_${now}.sqlite3 backup_job_filename=sqlite3_${db}_${now}.sqlite3
backup_job_filename_base=sqlite3_${db}.sqlite3 backup_job_filename_base=sqlite3_${db}
pre_dbbackup "${db}" pre_dbbackup "${db}"
write_log notice "Dumping sqlite3 database: '${backup_job_db_host}' ${compression_string}" write_log notice "Dumping sqlite3 database: '${backup_job_db_host}' ${compression_string}"
if var_true "${DEBUG_BACKUP_SQLITE3}" ; then debug on; fi if var_true "${DEBUG_BACKUP_SQLITE3}" ; then debug on; fi
@@ -872,6 +884,7 @@ backup_sqlite3() {
move_dbbackup move_dbbackup
check_exit_code move "${backup_job_filename}" check_exit_code move "${backup_job_filename}"
post_dbbackup "${db}" post_dbbackup "${db}"
cleanup_old_data
} }
check_availability() { check_availability() {
@@ -1338,20 +1351,20 @@ EOF
notify() { notify() {
if var_true "${DEBUG_NOTIFY}" ; then debug on; fi if var_true "${DEBUG_NOTIFY}" ; then debug on; fi
notification_custom() { notification_custom() {
if [ -n "${NOTIFICATION_SCRIPT}" ] ; then if [ -n "${NOTIFICATION_CUSTOM_SCRIPT}" ] ; then
if var_true "${NOTIFICATION_SCRIPT_SKIP_X_VERIFY}" ; then if var_true "${NOTIFICATION_CUSTOM_SCRIPT_SKIP_X_VERIFY}" ; then
eval "${NOTIFICATION_SCRIPT}" "${1}" "${2}" "${3}" "${4}" "${5}" eval "${NOTIFICATION_CUSTOM_SCRIPT}" "${1}" "${2}" "${3}" "${4}" "${5}"
else else
if [ -x "${NOTIFICATION_SCRIPT}" ] ; then if [ -x "${NOTIFICATION_CUSTOM_SCRIPT}" ] ; then
write_log notice "Found NOTIFICATION_SCRIPT environment variable. Executing '${NOTIFICATION_SCRIPT}" write_log notice "Found NOTIFICATION_CUSTOM_SCRIPT environment variable. Executing '${NOTIFICATION_CUSTOM_SCRIPT}"
# script timestamp logfile errorcode subject body # script timestamp logfile errorcode subject body
eval "${NOTIFICATION_SCRIPT}" "${1}" "${2}" "${3}" "${4}" "${5}" eval "${NOTIFICATION_CUSTOM_SCRIPT}" "${1}" "${2}" "${3}" "${4}" "${5}"
else else
write_log error "Can't execute NOTIFICATION_SCRIPT environment variable '${NOTIFICATION_SCRIPT}' as its filesystem bit is not executible!" write_log error "Can't execute NOTIFICATION_CUSTOM_SCRIPT environment variable '${NOTIFICATION_CUSTOM_SCRIPT}' as its filesystem bit is not executible!"
fi fi
fi fi
else else
print_error "[notifications] No NOTIFICATION_SCRIPT variable set - Skipping sending Custom notifications" print_error "[notifications] No NOTIFICATION_CUSTOM_SCRIPT variable set - Skipping sending Custom notifications"
fi fi
} }
@@ -1453,7 +1466,7 @@ EOF
# $4 body # $4 body
if var_true "${ENABLE_NOTIFICATIONS}" ; then if var_true "${ENABLE_NOTIFICATIONS}" ; then
notification_types=$(echo "${NOTIIFICATION_TYPE}" | tr "," "\n") notification_types=$(echo "${NOTIFICATION_TYPE}" | tr "," "\n")
for notification_type in $notification_types ; do for notification_type in $notification_types ; do
case "${notification_type,,}" in case "${notification_type,,}" in
"custom" ) "custom" )
@@ -1852,7 +1865,7 @@ timer() {
fi fi
done done
validate_all=$(echo "${validate_all}" | tr ' ' '\n' | sort -n -u | tr '\n' ' ') validate_all=$(echo "${validate_all}" | tr ' ' '\n' | sort -g -u | tr '\n' ' ')
for entry in $validate_all; do for entry in $validate_all; do
if [ ${entry} -ge ${3} ]; then if [ ${entry} -ge ${3} ]; then
echo "${entry}" echo "${entry}"