Skip to content

Commit b9fa7d1

Browse files
committed
Release 4.1.1 - See CHANGELOG.md
1 parent 626d276 commit b9fa7d1

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 4.1.1 2024-06-19 <dave at tiredofit dot ca>
2+
3+
### Changed
4+
- Fix issue where postgresql globals when backing up ALL not being deleted (#352)
5+
6+
17
## 4.1.0 2024-05-25 <dave at tiredofit dot ca>
28

39
Note that arm/v7 builds have been removed from this release going forward

install/assets/functions/10-db-backup

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,11 +525,11 @@ backup_influx() {
525525
print_debug "[backup_influx] Influx DB Version 1 selected"
526526
for db in ${db_names}; do
527527
prepare_dbbackup
528-
if var_true "${DEBUG_BACKUP_INFLUX}" ; then debug on; fi
528+
if var_true "${DEBUG_BACKUP_INFLUX}" ; then debug on; fi
529529
if [ "${db}" != "justbackupeverything" ] ; then bucket="-db ${db}" ; else db=all ; fi
530530
backup_job_filename=influx_${db}_${backup_job_db_host#*//}_${now}
531531
backup_job_filename_base=influx_${db}_${backup_job_db_host#*//}
532-
if var_true "${DEBUG_BACKUP_INFLUX}" ; then debug off; fi
532+
if var_true "${DEBUG_BACKUP_INFLUX}" ; then debug off; fi
533533
pre_dbbackup "${db}"
534534
write_log notice "Dumping Influx database: '${db}'"
535535
if var_true "${DEBUG_BACKUP_INFLUX}" ; then debug on; fi
@@ -742,6 +742,7 @@ backup_pgsql() {
742742
backup_pgsql_globals() {
743743
prepare_dbbackup
744744
backup_job_filename=pgsql_globals_${backup_job_db_host,,}_${now}.sql
745+
backup_job_global_base=pgsql_globals_${backup_job_db_host,,}
745746
compression
746747
pre_dbbackup "globals"
747748
print_notice "Dumping PostgresSQL globals: with 'pg_dumpall -g' ${compression_string}"
@@ -1063,6 +1064,10 @@ cleanup_old_data() {
10631064
write_log info "Cleaning up old backups on filesystem"
10641065
run_as_user mkdir -p "${backup_job_filesystem_path}"
10651066
find "${backup_job_filesystem_path}"/ -type f -mmin +"${backup_job_cleanup_time}" -iname "${backup_job_filename_base}*" -exec rm -f {} \;
1067+
if var_true "${_postgres_backup_globals}"; then
1068+
find "${backup_job_filesystem_path}"/ -type f -mmin +"${backup_job_cleanup_time}" -iname "${backup_job_global_base}*" -exec rm -f {} \;
1069+
fi
1070+
10661071
if [ -z "${backup_job_blobxfer_storage_account}" ] || [ -z "${backup_job_blobxfer_storage_account_key}" ]; then
10671072
write_log warn "Variable _BLOBXFER_STORAGE_ACCOUNT or _BLOBXFER_STORAGE_ACCOUNT_KEY is not set. Skipping blobxfer functions"
10681073
else
@@ -1074,6 +1079,9 @@ cleanup_old_data() {
10741079
write_log info "Cleaning up old backups on filesystem"
10751080
run_as_user mkdir -p "${backup_job_filesystem_path}"
10761081
run_as_user find "${backup_job_filesystem_path}"/ -type f -mmin +"${backup_job_cleanup_time}" -iname "${backup_job_filename_base}*" -exec rm -f {} \;
1082+
if var_true "${_postgres_backup_globals}"; then
1083+
run_as_user find "${backup_job_filesystem_path}"/ -type f -mmin +"${backup_job_cleanup_time}" -iname "${backup_job_global_base}*" -exec rm -f {} \;
1084+
fi
10771085
;;
10781086
"s3" | "minio" )
10791087
write_log info "Cleaning up old backups on S3 storage"

0 commit comments

Comments
 (0)